Originally Posted by

**Punch** Thomas had 899 sweets to be divided into n bags. He put 29 in the first bag. For each subsequent bag, he put 29 more than he did in the previous bag. He continued to fill the bags until there were enough sweets to fill the next bag in the same manner. Find the number of sweets that are left behind.

$\displaystyle S_n \leqslant 899$

$\displaystyle \frac{n}{2}[2a+(n-1)d] \leqslant 899$

$\displaystyle \frac{n}{2}[2(29)+(n-1)(29)] \leqslant 899$

$\displaystyle \frac{n}{2}[58+29n-29] \leqslant 899$

$\displaystyle n[29+29n] \leqslant 1798$

$\displaystyle 29n^2+29n-1798 \leqslant 0$

$\displaystyle n^2+n-62 \leqslant 0$

$\displaystyle \frac{-1-\sqrt{249}}{2} \leqslant n \leqslant \frac{-1+\sqrt{249}}{2}$

$\displaystyle \frac{-1+\sqrt{249}}{2}=7.3899$

Therefore, there were $\displaystyle 7$ bags filled full with sweets. $\displaystyle 0.3899$ of the $\displaystyle 8^{th}$ bag was left out.

Sweets left out$\displaystyle =8 x 29 x 0.3899=90.45$ sweets $\displaystyle \approx 91 sweets$

But the answer is $\displaystyle 7$