OFFSET
0,3
COMMENTS
Periodic sequence with period length 20. - Arkadiusz Wesolowski, Feb 12 2012
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).
FORMULA
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