%I #23 Sep 08 2022 08:46:01
%S 1,6,5,4,9,0,1,6,5,4,9,0,1,6,5,4,9,0,1,6,5,4,9,0,1,6,5,4,9,0,1,6,5,4,
%T 9,0,1,6,5,4,9,0,1,6,5,4,9,0,1,6,5,4,9,0,1,6,5,4,9,0,1,6,5,4,9,0,1,6,
%U 5,4,9,0,1,6,5,4,9,0,1,6,5,4,9,0,1,6
%N Period 6: repeat [1, 6, 5, 4, 9, 0].
%C The members of this sequence are also the units' digits of the indices of those nonzero square numbers that are also triangular.
%C The coefficients of x^n in the numerator of the generating function form the periodic cycle of the sequence.
%H Vincenzo Librandi, <a href="/A205651/b205651.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+6*x+5*x^2+4*x^3+9*x^4) / ((1-x)*(1+x)*(1-x+x^2)*(1+x+x^2)).
%F a(n) = a(n-6) for n>6.
%F a(n) = 25 - a(n-1) - a(n-2) - a(n-3) - a(n-4) - a(n-5) for n>5.
%F For n>0, a(n) = A010879(A001109(n)) = A010879(sqrt(A001110(n))) = mod(A001109(n),10).
%F a(n) = (25-5*cos(n*Pi)-10*cos(n*Pi/3)-10*cos(2*n*Pi/3)-2*sqrt(3)*(3*sin(n*Pi/3)+5*sin(2*n*Pi/3)))/6. - _Wesley Ivan Hurt_, Jun 18 2016
%e The fourth nonzero square number that is also a triangular number is 204^2. As 204 has units' digit 4, then a(4)=4.
%p A205651:=n->(25-5*cos(n*Pi)-10*cos(n*Pi/3)-10*cos(2*n*Pi/3)-2*sqrt(3)*(3*sin(n*Pi/3)+5*sin(2*n*Pi/3)))/6: seq(A205651(n), n=1..100); # _Wesley Ivan Hurt_, Jun 18 2016
%t LinearRecurrence[{0, 0, 0, 0, 0, 1}, {1, 6, 5, 4, 9, 0}, 86]
%t PadRight[{}, 120, {1, 6, 5, 4, 9, 0}] (* _Vincenzo Librandi_, Jun 19 2016 *)
%o (PARI) a(n)=[0, 1, 6, 5, 4, 9][n%6+1] \\ _Charles R Greathouse IV_, Jan 31 2012
%o (Magma) &cat[[1, 6, 5, 4, 9, 0]: n in [0..20]]; // _Wesley Ivan Hurt_, Jun 18 2016
%Y Cf. A001109, A001110, A010879.
%K nonn,easy
%O 1,2
%A _Ant King_, Jan 31 2012
|