OFFSET
1,2
COMMENTS
This is a periodic sequence with period 10 and cycle 1, 8, 1, 0, 5, 6, 3, 6, 5, 0.
FORMULA
a(n) = a(n-10).
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).
a(n) = (n*(3*n-2)) mod 10.
G.f.: x*(1 +8*x +x^2 +5*x^4 +6*x^5 +3*x^6 +6*x^7 +5*x^8)/((1-x)*(1+x)*(1 +x +x^2 +x^3 +x^4)*(1 -x +x^2 -x^3 +x^4)).
EXAMPLE
The seventh nonzero octagonal number is A000567(7)=133, which has units' digit 3. Hence a(7)=3.
MATHEMATICA
Table[Mod[n (3 n - 2), 10], {n, 100}]
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Ant King, Sep 02 2011
STATUS
approved