OFFSET
0,2
COMMENTS
Periodic with period 20: [0,2,8,4,4,0,4,6,8,8,0,8,2,6,6,0,6,4,2,2].
LINKS
Index entries for linear recurrences with constant coefficients, signature (0,1,0,-1,1,1,-1,-1,1,0,-1,0,1).
FORMULA
MAPLE
a:= n-> n*2&^n mod 10:
seq(a(n), n=0..100);
MATHEMATICA
a[n_] := Mod[n*2^n, 10]
PROG
(Python)
def a(n):
return (n * 2**n) % 10
(PARI) a(n, b=10) = lift(n*Mod(2, b)^n) \\ Hugo Pfoertner, May 24 2024
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Javier Rodríguez Ríos, May 23 2024
STATUS
approved