A365935 Final digit (in decimal system) of n^(n+1) = A007778(n).
0, 1, 8, 1, 4, 5, 6, 1, 8, 1, 0, 1, 2, 9, 4, 5, 6, 9, 2, 1, 0, 1, 8, 1, 4, 5, 6, 1, 8, 1, 0, 1, 2, 9, 4, 5, 6, 9, 2, 1, 0, 1, 8, 1, 4, 5, 6, 1, 8, 1, 0, 1, 2, 9, 4, 5, 6, 9, 2, 1, 0, 1, 8, 1, 4, 5, 6, 1, 8, 1, 0, 1, 2, 9, 4, 5, 6, 9, 2, 1, 0, 1, 8, 1, 4, 5, 6
Offset: 0
Examples
For n = 3, a(3) = 3^4 mod 10 = 81 mod 10 = 1.
Links
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1).
Programs
-
Mathematica
a[n_]:=Last[IntegerDigits[n^(n+1)]]; Array[a,87,0] (* Stefano Spezia, Sep 26 2023 *)
-
PARI
a(n) = lift(Mod(n, 10)^(n+1)); \\ Michel Marcus, Sep 23 2023
Comments