OFFSET
1,2
COMMENTS
Periodic with period 20. - R. J. Mathar, May 21 2010
Also, units digits of the pentagonal numbers. - Ant King, Jul 12 2011
LINKS
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,1,0,0,0,0,-1,0,0,0,0,1).
FORMULA
From R. J. Mathar, May 21 2010: (Start)
a(n) = A000326(n) mod 10.
a(n) = a(n-5) - a(n-10) + a(n-15). (End)
a(n) = a(n-20). - Ant King, Jul 12 2011
a(n) = 70 - a(n-1) - a(n-2) - a(n-3) - ... - a(n-19). - Ant King, Jul 12 2011
EXAMPLE
a(1) = 1 mod 10 = 1;
a(2) = (3 + 4 + 5) mod 10 = 12 mod 10 = 2;
a(21) = (21 + 22 + ... + 41) mod 10 = 651 mod 10 = 1.
MATHEMATICA
Table[Mod[n*(3*n - 1)/2, 10], {n, 100}] (* Ant King, Jul 12 2011 *)
LinearRecurrence[{0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1}, {1, 5, 2, 2, 5, 1, 0, 2, 7, 5, 6, 0, 7, 7, 0}, 90] (* Harvey P. Dale, Nov 01 2020 *)
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Juri-Stepan Gerasimov, Jun 10 2009
EXTENSIONS
Entries confirmed by R. J. Mathar, May 21 2010
STATUS
approved