# Calculate $1^{30} + 2^{30} + 3^{30} + \ldots + 17^{30} \mod 31$

Calculate $1^{30} + 2^{30} + 3^{30} + \ldots + 17^{30} \mod 31$

Using Fermat's Theorem: $$1^{30} = 1 \mod 31,$$ (since $31$ is prime). This implies the above is congruent to $17 \mod 31$

This is correct, right?

-
I think you have a typo in your solution: $1^{30} = 1$ (mod $31$), while true, is not what you meant to say (i.e. you need this fact for all the other 30th powers too). [See the answers below.] –  Matt E Oct 18 '10 at 15:24

True. But 1^n=1 mod whatever. Fermat's Little Theorem says that n^30=1 for all n prime to 31. So your answer of 17 is correct.

-