A120962 Final digit (in decimal system) of n^(n^n), i.e., n^(n^n) mod 10.
0, 1, 6, 7, 6, 5, 6, 3, 6, 9, 0, 1, 6, 3, 6, 5, 6, 7, 6, 9, 0, 1, 6, 7, 6, 5, 6, 3, 6, 9, 0, 1, 6, 3, 6, 5, 6, 7, 6, 9, 0, 1, 6, 7, 6, 5, 6, 3, 6, 9, 0, 1, 6, 3, 6, 5, 6, 7, 6, 9, 0, 1, 6, 7, 6, 5, 6, 3, 6, 9, 0, 1, 6, 3, 6, 5, 6, 7, 6, 9, 0, 1, 6, 7, 6, 5, 6, 3, 6, 9, 0, 1, 6, 3, 6, 5, 6, 7, 6, 9, 0, 1, 6, 7, 6, 5
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0,1,0,-1,0,1,0,-1,0,1,0,-1,0,1,0,-1,0,1).
Programs
-
Maple
seq(n &^ (n^n) mod 10, n=0..105);
-
Mathematica
Join[{0}, Table[PowerMod[n, n^n, 10], {n, 100}]] (* Stefan Steinerberger, Nov 23 2007 *)
-
PARI
a(n)=if(n%10,lift(Mod(n,10)^lift(Mod(n,20)^n)),0) \\ Charles R Greathouse IV, Feb 12 2012
-
Python
def A120962(n): return pow(n,n**n,10) # Chai Wah Wu, Sep 22 2023
Formula
Extensions
More terms from Stefan Steinerberger, Nov 23 2007
Comments