During a test, I was told to calculate the exact value of this: $S=1^2+2^2+3^2+\cdots+10000$
This is what I did:
Observe the following: $(S=1^2+2^2+3^2+\cdots+100^2)\wedge (S=100^2+\cdots+3^2+2^2+1^2)$ Is true. Therefore, $2S = (1^2+2^2+3^2+\cdots+100^2) + (100^2+\cdots+3^2+2^2+1^2) = 100\cdot101^2$ So, $S=50\cdot(101^2)$ $=50\cdot10201$ $=510050$
I was wrong.
There was no explanation in the result page, so I am not very sure what went wrong. But yeah, upon returning home, I tried to evaluate this with Java:
int x = 0; for (int i = 1; i <= 100; ++i) { x += Math.pow(i,2); } System.out.println(x);
It returns $338350$.
Could you tell me what did I do wrong? It may seem obvious, but clearly I'm not able to see it.
Furthermore, apparently this kind of question is under the category of mathematical induction. Honestly, the only thing I've been doing with induction was prove some equalities, inequalities and divisibility. How is this exactly related to induction?