Given a integer $n$, determine the remainder of dividing $n^n$ for 5 in terms of an adequate congruence for n.
So I'm really stuck in this exercise.
By Euler little theorem I know $n^4 \equiv 1 \mod5$ if $(n,5)=1$
Then, I'll be inclined to use somthing like $n = 4k + r, 0 \leq r \leq 3$
the problem is how do I determine the $n$s that actually are $(n,5)=1$ and those who are not...
Note that if $5|n$ then the answer is $0$
If $n\equiv 1 \mod 5$ then the remainder will always be $1$
If $n\equiv -1 \mod 5$ then the remainder will be $1$ or $4$ dependent on whether $n$ is even or odd (note: $-1$ has order $2$ in the multiplicative group of non-zero residues, and the answer therefore depends on $n \mod 2$).
If $n\equiv 2,3 \mod 5$ - these being primitive roots - you have four cases for each depending on the residue class of $n \mod 4$.