%I #34 Sep 21 2019 14:35:27
%S 1,4,4,7,1,1,7,4,7,1,7,4,4,7,1,7,4,7,1,1,7,4,4,1,1,4,4,7,1,1,7,4,7,1,
%T 7,4,4,7,1,7,4,7,1,1,7,4,4,1,1,4,4,7,1,1,7,4,7,1,7,4,4,7,1,7,4,7,1,1,
%U 7,4,4,1
%N Digital root of squares of numbers not divisible by 2, 3 or 5.
%C This period 24 repeating sequence is palindromic.
%H Colin Barker, <a href="/A240924/b240924.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_15">Index entries for linear recurrences with constant coefficients</a>, signature (2,-1,-1,2,-1,-1,2,-2,1,1,-2,1,1,-2,1).
%F From _Colin Barker_, Sep 21 2019: (Start)
%F G.f.: x*(1 + x)^2*(1 - 4*x^2 + 12*x^3 - 27*x^4 + 45*x^5 - 53*x^6 + 45*x^7 - 27*x^8 + 12*x^9 - 4*x^10 + x^12) / ((1 - x)*(1 - x + x^2)*(1 - x^2 + x^4)*(1 - x^4 + x^8)).
%F a(n) = 2*a(n-1) - a(n-2) - a(n-3) + 2*a(n-4) - a(n-5) - a(n-6) + 2*a(n-7) - 2*a(n-8) + a(n-9) + a(n-10) - 2*a(n-11) + a(n-12) + a(n-13) - 2*a(n-14) + a(n-15) for n>15.
%F (End)
%e The first 8 numbers not divisible by 2, 3 or 5 are 1,7,11,13,17,19,23,29; with squares 1,49,121,169,289,361,529,841 and digital root sequence of 1,4,4,7,1,1,7,4.
%o (Python)
%o A240924 = [1 + (n*n-1) % 9 for n in range(1,10**3,2) if n % 3 and n % 5 ]
%o # _Chai Wah Wu_, Sep 03 2014
%o (PARI) Vec(x*(1 + x)^2*(1 - 4*x^2 + 12*x^3 - 27*x^4 + 45*x^5 - 53*x^6 + 45*x^7 - 27*x^8 + 12*x^9 - 4*x^10 + x^12) / ((1 - x)*(1 - x + x^2)*(1 - x^2 + x^4)*(1 - x^4 + x^8)) + O(x^100)) \\ _Colin Barker_, Sep 21 2019
%Y Cf. A007775, A166923.
%K nonn,base,easy
%O 1,2
%A _Gary Croft_, Aug 15 2014