OFFSET
1,2
COMMENTS
This is a periodic sequence with period 10 and cycle 1, 6, 5, 8, 5, 6, 1, 0, 3, 0.
As the sum of the terms contained in each cycle is 35 they also satisfy the ninth-order inhomogeneous recurrence a(n)=35-a(n-1)-a(n-2)-a(n-3)-a(n-4)-a(n-5)-a(n-6)-a(n-7)-a(n-8)-a(n-9).
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,0,0,0,0,1).
FORMULA
a(n) = a(n-10).
a(n) = (n*(2*n-1)) mod 10.
G.f. -x*(1+6*x+5*x^2+8*x^3+5*x^4+6*x^5+x^6+3*x^8) / ( (x-1)*(1+x)*(x^4+x^3+x^2+x+1)*(x^4-x^3+x^2-x+1) ). - R. J. Mathar, Aug 30 2011
EXAMPLE
The seventh nonzero hexagonal number is A000384(7)=91, which has units' digit 1. Hence a(7)=1.
MATHEMATICA
Mod[# (2#-1), 10] &/@Range[100]
Mod[PolygonalNumber[6, Range[100]], 10] (* Harvey P. Dale, Oct 04 2024 *)
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Ant King, Aug 30 2011
STATUS
approved