So I am struggling a bit with this question
$n$ is prime
we can ignore $2$ and $5$ as $n>5$
now if $n$ is prime
for the digits: $\{0,1,2,3,4,5,6,7,8,9\}$
$\{0,2,4,6,8\}$ can be discounted as $n$ cannot be even that
$5$ can be discounted as $n$ is not a multiple of $5$ either
therefore any prime must have the last digit $q$ such that $q\subset\{1,3,7,9\}$
For $n^4$, if $n=10p+q$
for a natural number $p$
I don't quite know how I can get to the desired result.
If $n$ is prime $p>5$ then $$n\equiv \pm1,\pm 3 \pmod{10}$$ that is final digit of $n$ is $1,3,7$ or $9$, so $$n^2\equiv \pm1 \pmod{10}$$ that is final digit of $n^2$ is $1$ or $9$, so $$n^4\equiv 1 \pmod{10}$$ that is final digit of $n^4$ is $1$.