OFFSET
1,2
COMMENTS
This is a periodic sequence with period 20 and cycle 1, 7, 8, 4, 5, 1, 2, 8, 9, 5, 6, 2, 3, 9, 0, 6, 7, 3, 4, 0.
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
a(n) = a(n-20).
a(n) = a(n-5) -a(n-10) +a(n-15).
a(n) = 45 -a(n-1) -a(n-2) -a(n-3) -a(n-4) -a(n-10) -a(n-11) -a(n-12) -a(n-13) -a(n-14).
a(n) = 90 -a(n-1) -a(n-2) -a(n-3) -... -a(n-17) -a(n-18) -a(n-19).
a(n) = (n*(5*n-3)/2) mod 10.
G.f.: -x*(4*x^13 +3*x^12 +7*x^11 +6*x^10 +5*x^8 -5*x^6 +5*x^4 +4*x^3 +8*x^2 +7*x +1) / ((x -1)*(x^2 +1)*(x^4 +x^3 +x^2 +x +1)*(x^8 -x^6 +x^4 -x^2 +1)). - Colin Barker, Sep 23 2013
EXAMPLE
The seventh nonzero heptagonal number is A000566(7)=112, which has units' digit 2. Hence a(7)=2.
MATHEMATICA
Table[Mod[n*(5*n-3)/2, 10], {n, 100}]
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Ant King, Aug 31 2011
STATUS
approved