A175348 Last digit of p^p, where p is the n-th prime.
4, 7, 5, 3, 1, 3, 7, 9, 7, 9, 1, 7, 1, 7, 3, 3, 9, 1, 3, 1, 3, 9, 7, 9, 7, 1, 7, 3, 9, 3, 3, 1, 7, 9, 9, 1, 7, 7, 3, 3, 9, 1, 1, 3, 7, 9, 1, 7, 3, 9, 3, 9, 1, 1, 7, 7, 9, 1, 7, 1, 7, 3, 3, 1, 3, 7, 1, 7, 3, 9, 3, 9, 3, 3, 9, 7, 9, 7, 1, 9, 9, 1, 1, 3, 9, 7, 9, 7, 1, 7, 3, 9, 3, 1, 9, 7, 9, 1, 7, 1, 3, 7, 7, 9, 1
Offset: 1
Examples
prime(4) = 7 and 7^7 = 823543, so a(4) = 3.
References
- R. Euler and J. Sadek, A number that gives the unit digit of n^n. Journal of Recreational Mathematics, 29:3 (1998), pp. 203-204.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
R:= [seq(i &^ i mod 10, i=1..20)]: seq(R[ithprime(i) mod 20],i=1..100); # Robert Israel, Jan 26 2017
-
Mathematica
Table[PowerMod[n,n,10],{n,Prime[Range[110]]}] (* Harvey P. Dale, Mar 24 2024 *)
-
PARI
a(n)=[1,4,7,0,5,0,3,0,9,0,1,0,3,0,0,0,7,0,9][prime(n)%20]
Comments