login
A120962
Final digit (in decimal system) of n^(n^n), i.e., n^(n^n) mod 10.
7
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,3
COMMENTS
Periodic sequence with period length 20. - Arkadiusz Wesolowski, Feb 12 2012
LINKS
FORMULA
a(n) = A010879(A002488(n)). - Michel Marcus, Aug 04 2015
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
N. J. A. Sloane, Jul 19 2006, Oct 26 2007
EXTENSIONS
More terms from Stefan Steinerberger, Nov 23 2007
STATUS
approved