# Divisibility of polynomial; basic number theory [duplicate]

Show that $42|(n^7 - n)$ for all integers $n$

The only hint I've been given uses Fermat's Little Theorem but I don't know how to use that in this case since $42$ is not a prime.

• you can write $42=2\cdot 3\cdot 7$ – Yanko Jan 27 '18 at 14:36
• At least you could have viewed my edit :( – Yash Jain Jan 27 '18 at 14:37

Well, $42=2\times3\times7$ and:
• $n$ and $n^7$ have the same parity, which means that $2\mid n^7-n$;
• by Fermat's little theorem, $3\mid n^3-n$, and$$n^7-n=n^7-n^5+n^5-n^3+n^3-n=(n^4+n^2+1)(n^3-n),$$which implies that $3\mid n^7-n$;
• by Fermat's little theorem, $7\mid n^7-n$.
Since $2$, $3$, and $7$ are co-prime, this implies that $42\mid n^7-n$.