<s>[INST] What is the maximum number of distinct positive integer's square that sums up to $2002$? 
What is the maximum number of distinct positive integer's square that sums up to $2002$ ?

My tries:
$$\frac{n(n+1)(2n+1)}{6} = 2002$$
 $$\implies n\approx 17 $$ but am clueless as to how to proceed any further.
 [/INST] From $\frac {17(17+1)(2\cdot 17+1)}6 \lt 2002 \lt \frac {18(18+1)(2\cdot 18+1)}6$ you can conclude that at most $17$ distinct squares can be chosen to sum to $2002$ because the smallest $18$ add up to too much.  Now you need to show that you can find $17$.  If we were asked the same question for $34$ we could conclude from $1^2+2^2+3^2+4^2$ that it was at most $4$, but in fact the best we can do is $3^2+5^2$ for two.  We have $\frac {17(17+1)(2\cdot 17+1)}6=1785$ so you need to increase the sum by $217$.  If we delete $a^2$ from the list and add $b^2$ we want $b^2-a^2=217=(b-a)(b+a)=7\cdot 31$, which gives $b=19,a=12$ and our list is all the numbers from $1$ to $17$ except $12$ plus $19$
</s>