login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A365689
Final decimal digit of n^((n+1)^(n+2)) = A030198(n).
2
0, 1, 2, 1, 4, 5, 6, 1, 8, 1, 0, 1, 2, 1, 4, 5, 6, 1, 8, 1, 0, 1, 2, 1, 4, 5, 6, 1, 8, 1, 0, 1, 2, 1, 4, 5, 6, 1, 8, 1, 0, 1, 2, 1, 4, 5, 6, 1, 8, 1, 0, 1, 2, 1, 4, 5, 6, 1, 8, 1, 0, 1, 2, 1, 4, 5, 6, 1, 8, 1, 0, 1, 2, 1, 4, 5, 6, 1, 8, 1, 0, 1, 2, 1, 4, 5, 6
OFFSET
0,3
COMMENTS
Period 10, repeat: [0, 1, 2, 1, 4, 5, 6, 1, 8, 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
Cf. A030198, A103562, A120962, A365689 (initial digit).
Sequence in context: A075423 A144774 A326056 * A373948 A074720 A323456
KEYWORD
nonn,base,easy
AUTHOR
Marco Ripà, Sep 16 2023
STATUS
approved