OFFSET
0,3
COMMENTS
Period 10, repeat: [0, 1, 2, 1, 4, 5, 6, 1, 8, 1].
LINKS
Paolo Xausa, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,0,0,0,0,1).
FORMULA
a(n) = n^((n+1)^(n+2)) mod 10.
a(n) = A103562(n) for n >= 4 (as 3^(2^1) == 9 (mod 10) instead of 1).
EXAMPLE
For n = 2, a(2) = 2417851639229258349412352 mod 10 = 2.
MATHEMATICA
PadRight[{}, 100, {0, 1, 2, 1, 4, 5, 6, 1, 8, 1}] (* Paolo Xausa, Oct 16 2023 *)
PROG
(PARI) a(n) = lift(Mod(n, 10)^((n+1)^(n+2))); \\ Michel Marcus, Sep 16 2023
(Python)
def A365689(n): return pow(n, (n+1)**(n+2), 10) # Chai Wah Wu, Sep 22 2023
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Marco Ripà, Sep 16 2023
STATUS
approved