<s>[INST] How to prove that $n^7\equiv n^3\mod40,\forall n\in\mathbb{Z}$ I have a problem when I try to induction on $\mathbb{Z}$. I don't know how to solve when I try $n-1$ or $n+1$. 
 [/INST] $$n^7-n^3=n^3(n^4-1)=n^2(n^5-n)$$
Using Fermat's Little Theorem, $5|(n^5-n)$
If $n$ is even $8|n^3$
Else $\displaystyle n$ is odd, $=2m+1,$(say),
Both $n+1,n-1$ are even, one is divisible by $4$ and the other is by $2$
Algebraically,  $\displaystyle(2m+1)^2=4m^2+4m+1=8\frac{m(m+1)}2+1\implies 8|(n^2-1)$  if $n$ is odd

Alternatively,
$$F=n^7-n^3=n^3(n^4-1)=n^3(n^2-1)(n^2+1)$$
$$=n(n^2-4+4)(n^2-1)(n^2+1)$$
$$=n(n^2-4)(n^2-1)(n^2+1)+4\cdot n(n^2-1)(n^2+1)$$
$$=n(n^2-4)(n^2-1)\cdot  (n^2+1)+4\cdot n(n^2-1)(n^2-4+5)$$
$$=\underbrace{(n-2)(n-1)n(n+1)(n+2)}_{\text{The product of } 5 \text{ consecutive integers}}\left[n^2+1+4\right]+20\underbrace{(n-1)n(n+1)}_{\text{The product of } 3 \text{ consecutive integers}}$$
Now utilize The product of n consecutive integers is divisible by n factorial or The product of n consecutive integers is divisible by n! (without using the properties of binomial coefficients) to find that $F$ is actually divisible by $20\cdot 3!=120$
</s>