A373098 Last digit of n*2^n.
0, 2, 8, 4, 4, 0, 4, 6, 8, 8, 0, 8, 2, 6, 6, 0, 6, 4, 2, 2, 0, 2, 8, 4, 4, 0, 4, 6, 8, 8, 0, 8, 2, 6, 6, 0, 6, 4, 2, 2, 0, 2, 8, 4, 4, 0, 4, 6, 8, 8, 0, 8, 2, 6, 6, 0, 6, 4, 2, 2, 0, 2, 8, 4, 4, 0, 4, 6, 8, 8, 0, 8, 2, 6, 6, 0, 6, 4, 2, 2, 0, 2, 8, 4, 4, 0, 4, 6, 8, 8, 0, 8, 2, 6, 6, 0, 6, 4, 2, 2
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0,1,0,-1,1,1,-1,-1,1,0,-1,0,1).
Programs
-
Maple
a:= n-> n*2&^n mod 10: seq(a(n), n=0..100);
-
Mathematica
a[n_] := Mod[n*2^n, 10]
-
PARI
a(n,b=10) = lift(n*Mod(2,b)^n) \\ Hugo Pfoertner, May 24 2024
-
Python
def a(n): return (n * 2**n) % 10
Comments