Proving divisibility of sum of seven consecutive integers by 7 using congruence theories

divisibilitymodular arithmeticnumber theory

I have have this peculiar problem below;

For which values of n, a consecutive set of seven integers, raised to it's nth power and added together, will be divisible by 7?

For example if a is any integer then the sum of seven consecutive integers when n=1 is;

a + (a+1) + (a+2) + (a+3) + (a+4) + (a+5) + (a+6) = 7a+21

which is divisible by 7.

I can prove it's divisible using polynomials for n=2,3 or 4 but that doesn't involve the use of congruence theories. I tried to apply Fermat Little Theorem, but it didn't get me anywhere

Best Answer

$a,a+1,a+2,a+3,a+4,a+5$, and $a+6$ comprise a complete set of residues modulo $7$,

so we can take $a=0$ without loss of generality.

For $n=1$, the sum is congruent to $0+1+2+3+4+5+6\equiv0\bmod7$.

For $n=2$, the sum is congruent to $0+1+4+2+2+4+1\equiv0\bmod7$.

For $n=3$, the sum is congruent to $0+1+1-1+1-1-1\equiv0\bmod7$.

For $n=4$, the sum is congruent to $0+1+2+4+4+2+1\equiv0\bmod7$.

For $n=5$, the sum is congruent to $0+1+4+5+2+3+6\equiv0\bmod7$.

For $n=6$, the sum is congruent to $0+1+1+1+1+1+1\equiv6\bmod7$.

For $n=6k+m$, the sum is congruent to that for $m$, as a consequence of Fermat's little theorem.

Therefore, the sum is a multiple of $7$ unless $n$ is a multiple of $6$.

Related Question