Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #22 Sep 08 2022 08:46:01
%S 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,
%T 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,
%U 9,8,1,0,1,8,9,8,1,0,1,8,9,8,1,0,1,8
%N Period 6: repeat [1, 8, 9, 8, 1, 0].
%C The terms of this sequence are the units' digits of the indices of those nonzero triangular numbers that are also perfect squares (A001108).
%H Vincenzo Librandi, <a href="/A205185/b205185.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0, 0, 0, 0, 0, 1).
%F G.f.: x*(1+7x+x^2) / ((1-x)*(1+x)*(1-x+x^2)).
%F a(n) = a(n-6) for n>6.
%F a(n) = 9-a(n-3) for n>3.
%F a(n) = a(n-1) - a(n-3) + a(n-4) for n>4.
%F a(n) = 1/6*(27+(-1)^n*(5-32*cos(2*n*Pi/3))).
%e 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.
%p A205185:=n->[1, 8, 9, 8, 1, 0][(n mod 6)+1]: seq(A205185(n), n=0..100); # _Wesley Ivan Hurt_, Jun 18 2016
%t LinearRecurrence[{0, 0, 0, 0, 0, 1}, {1, 8, 9, 8, 1, 0}, 86]
%t PadRight[{}, 100, {1, 8, 9, 8, 1, 0}] (* _Vincenzo Librandi_, Jun 19 2016 *)
%o (Magma) &cat[[1, 8, 9, 8, 1, 0]: n in [0..20]]; // _Wesley Ivan Hurt_, Jun 18 2016
%o (PARI) a(n)=[0, 1, 8, 9, 8, 1][n%6+1] \\ _Charles R Greathouse IV_, Jul 17 2016
%Y Cf. A000217, A000290, A001108, A010879.
%K nonn,easy
%O 1,2
%A _Ant King_, Jan 24 2012