A365689 Final decimal digit of n^((n+1)^(n+2)) = A030198(n).
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
Examples
For n = 2, a(2) = 2417851639229258349412352 mod 10 = 2.
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).
Programs
-
Mathematica
PadRight[{},100,{0,1,2,1,4,5,6,1,8,1}] (* Paolo Xausa, Oct 16 2023 *)
-
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
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).
G.f.: x*(x^8+8*x^7+x^6+6*x^5+5*x^4+4*x^3+x^2+2*x+1)/(1-x^10). - Alois P. Heinz, Apr 18 2025
Comments