OFFSET
1,2
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,1,-1).
FORMULA
a(n) = a(n-1)+a(n-5)-a(n-6).
G.f.: x*(8*x^4+x^3+5*x^2+3*x+1) / ((x-1)^2*(x^4+x^3+x^2+x+1)).
EXAMPLE
18 is in the sequence because the digital root of 18 is 9, and 18^2/9 = 36 = 6^2.
PROG
(PARI) s=[]; for(n=1, 300, d=(n-1)%9+1; if(n^2%d==0 && issquare(n^2\d), s=concat(s, n))); s
(PARI) Vec(x*(8*x^4+x^3+5*x^2+3*x+1)/((x-1)^2*(x^4+x^3+x^2+x+1)) + O(x^100))
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Colin Barker, Jan 29 2014
STATUS
approved