When n is even, the result is a multiple of 2 and not equal to 2 and therefore composite.
When n is odd, 4^n always ends in 4, as 4^1 ends in 4, and then using mathematical induction, since 4^2 = 16 and 6 * 4 (the last digits) ends in 4, if 4^n ends in 4, then so does 4^(n+2).
For odd n > 1, up to 11, n^4 is shown:
n n^4
3 81
5 625
7 2401
9 6561
11 14641
Also (n+10)^4 = n^4+40*n^3+600*n^2+4000*n+10000, so going from n to n+10, the last digit of n^4 does not change. Thus the last digit is 1 for any odd n other than a multiple of 5.
Added to the number ending in 4, the total ends in 5 and is therefore a multiple of 5 and not prime.
This leaves only the odd multiples of 5 to worry about.

Posted by Charlie
on 20040812 13:52:16 