Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #19 Jul 17 2016 19:43:38
%S 1,8,4,9,7,8,7,9,4,8,1,9,1,8,4,9,7,8,7,9,4,8,1,9,1,8,4,9,7,8,7,9,4,8,
%T 1,9,1,8,4,9,7,8,7,9,4,8,1,9,1,8,4,9,7,8,7,9,4,8,1,9,1,8,4,9,7,8,7,9,
%U 4,8,1,9,1,8,4,9,7,8,7,9,4,8,1,9,1,8
%N Period 12: repeat (1, 8, 4, 9, 7, 8, 7, 9, 4, 8, 1, 9).
%C The terms of this sequence are the digital roots of the indices of those nonzero triangular numbers that are also perfect squares (A001108).
%H <a href="/index/Rec#order_08">Index entries for linear recurrences with constant coefficients</a>, signature (0, 1, 0, 0, 0, -1, 0, 1).
%F G.f.: x*(1+8*x+3*x^2+x^3+3*x^4-x^5+x^6+9*x^7) / ((1-x)*(1+x)*(1+x^2)*(1-sqrt(3)*x+x^2)*(1+sqrt(3)*x+x^2)).
%F a(n) = a(n-12).
%F a(n) = 25-a(n-1)-a(n-6)-a(n-7).
%F a(n) = a(n-2)-a(n-6)+a(n-8).
%F a(n) = 1/4*(25+(-1)^n*(9+4*sqrt(3)*(cos(n*Pi/6)-cos(5*n*Pi/6))+2*cos(n*Pi/2))).
%e As the fourth nonzero triangular number that is also a perfect square is A000217(288), and 288 has digital root A010888(288)=9, then a(4)=9.
%t LinearRecurrence[{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, {1, 8, 4, 9, 7, 8, 7, 9, 4, 8, 1, 9}, 86]
%t LinearRecurrence[{0, 1, 0, 0, 0, -1, 0, 1},{1, 8, 4, 9, 7, 8, 7, 9},86] (* _Ray Chandler_, Aug 03 2015 *)
%o (PARI) a(n)=[9, 1, 8, 4, 9, 7, 8, 7, 9, 4, 8, 1][n%12+1] \\ _Charles R Greathouse IV_, Jul 17 2016
%Y Cf. A001108, A000217, A010888, A000290.
%K nonn,easy
%O 1,2
%A _Ant King_, Jan 23 2012