login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A205185
Period 6: repeat [1, 8, 9, 8, 1, 0].
1
1, 8, 9, 8, 1, 0, 1, 8, 9, 8, 1, 0, 1, 8, 9, 8, 1, 0, 1, 8, 9, 8, 1, 0, 1, 8, 9, 8, 1, 0, 1, 8, 9, 8, 1, 0, 1, 8, 9, 8, 1, 0, 1, 8, 9, 8, 1, 0, 1, 8, 9, 8, 1, 0, 1, 8, 9, 8, 1, 0, 1, 8, 9, 8, 1, 0, 1, 8, 9, 8, 1, 0, 1, 8, 9, 8, 1, 0, 1, 8, 9, 8, 1, 0, 1, 8
OFFSET
1,2
COMMENTS
The terms of this sequence are the units' digits of the indices of those nonzero triangular numbers that are also perfect squares (A001108).
FORMULA
G.f.: x*(1+7x+x^2) / ((1-x)*(1+x)*(1-x+x^2)).
a(n) = a(n-6) for n>6.
a(n) = 9-a(n-3) for n>3.
a(n) = a(n-1) - a(n-3) + a(n-4) for n>4.
a(n) = 1/6*(27+(-1)^n*(5-32*cos(2*n*Pi/3))).
EXAMPLE
As the fourth nonzero triangular number that is also a perfect square is A000217(288), and 288 has units' digit A010879(288)=8, then a(4)=8.
MAPLE
A205185:=n->[1, 8, 9, 8, 1, 0][(n mod 6)+1]: seq(A205185(n), n=0..100); # Wesley Ivan Hurt, Jun 18 2016
MATHEMATICA
LinearRecurrence[{0, 0, 0, 0, 0, 1}, {1, 8, 9, 8, 1, 0}, 86]
PadRight[{}, 100, {1, 8, 9, 8, 1, 0}] (* Vincenzo Librandi, Jun 19 2016 *)
PROG
(Magma) &cat[[1, 8, 9, 8, 1, 0]: n in [0..20]]; // Wesley Ivan Hurt, Jun 18 2016
(PARI) a(n)=[0, 1, 8, 9, 8, 1][n%6+1] \\ Charles R Greathouse IV, Jul 17 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ant King, Jan 24 2012
STATUS
approved