(i) Why a multiple of 180
Each way of stacking leaves 5 over. Remove those 5, and the rest can be stacked exactly in piles of 12, of 15 and of 18. So (number − 5) is a common multiple of 12, 15 and 18.
12=22×315=3×518=2×32
LCM(12,15,18)=22×32×5=180
Every common multiple of 12, 15 and 18 is a multiple of their LCM, so (number − 5) is a multiple of 180.
(ii) The number of badam barfis
The possible numbers are
180k+5:185,365,545,725, …
Only 545 lies between 500 and 600.
Check:
545=12×45+5545=15×36+5545=18×30+5 ✓
Answer: 545 badam barfis.
(iii) Equal stacks, fewest in number
The stack height must divide both 545 and 420. Fewest stacks means the tallest possible stacks — the HCF.
545=5×109
420=22×3×5×7
(109 is prime: it is not divisible by 2, 3, 5 or 7, and 112=121>109.)
The only common prime is 5:
HCF(545,420)=5
So each stack has 5 barfis, and the number of stacks is
5545+5420=109+84=193
Answer: stacks of 5 barfis; 193 stacks in all.
(iii) OR — How many more to buy
She needs a number that 12, 15 and 18 all divide exactly — a multiple of 180 — and it must be more than 545.
180×3=540 (less than 545)180×4=720
So she needs 720 barfis, and must buy
720−545=175
Answer: 175 more badam barfis.