(i) From the bottom up, the layers have 20, 19, 18, …, 8 pipes. The numbers from 8 to 20 are 20−8+1=13 numbers, so there are 13 layers.
(ii) The total is 8+9+⋯+20. This is the sum of the first 20 natural numbers minus the sum of the first 7:
8+9+⋯+20=S20−S7
S20=220×21=210,S7=27×8=28
S20−S7=210−28=182
There are 182 pipes. Check with Āryabhaṭa's rule: the average of the first and last layers is 28+20=14, and 14×13=182.