Although I can prove these algebraically via induction, how are the following proved using modular arithmetic (where "=" means "congruent to")?
1+2+...+(n-1)=0 mod n iff n is odd
1^2+2^2+...+(n-1)^2=0 mod n iff n=+/-1 mod 6
1^3+2^3+...+(n-1)^3=0 mod n iff n is not congruent to 2 mod 4
For the sum of the first n cubes, if we let n=4k+i, where i={0, 1, 2, 3} we expect to NOT get an integer multiple of k in the case of 4k+2, which happens to be true when you work out the algebra. But, we would expect integer multiples of k in the other three cases. However, 4k+3 does not produce an integer multiple of k. What am I doing wrong?
Thanks!