Q:

For how many natural numbers(<=100) is $1111^n +2222^n+3333^n+4444^n$ divisible by 10?

For how many natural numbers (0 not included) $n \leq 100$ is $1111^n +2222^n+3333^n+4444^n$ divisible by 10?
I factored out $1111^n$ and got $1111^n(1+2^n+3^n+4^n)$. So $1+2^n+3^n+4^n$ must be divisible by 10. I figured out that this is divisible by 10 for all odd n, but I don't know how to find the other solutions, if any.

A:

If you divide $1^n$, $2^n$, $3^n$, and $4^n$ by 10, each goes through a cycle of remainders:
$1: 1, 1, 1, 1$
$2: 2, 4, 8, 6$
$3: 3, 9, 7, 1$
$4: 4, 6, 4, 6$
So $1^n+2^n +3^n + 4^n$ goes through the cycle of remainders $0, 0, 0, 4$, and thus will be divisible by $10$ whenever $n$ is not divisible by $4$.

