We will first solve Shape 1 and Shape 2 to understand the logic.
Logic: Next number formed is (number x (number – 2)) – number ...