OFFSET
1,2
LINKS
Harry J. Smith, Table of n, a(n) for n = 1..1001
Amarnath Murthy & Charles Ashbacher, Fabricating a perfect square with a given valid digit sum, in Generalized Partitions and New Ideas On Number Theory and Smarandache Sequences, pp 154-156.
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
From Colin Barker, Apr 21 2012: (Start)
a(n) = (9*n+2)^2/4 for n even; a(n)=(9*n+7)^2/4 for n odd.
G.f.: x*(1+63*x+34*x^2+63*x^3+x^4)/((1-x)^3*(1+x)^2). (End)
a(n) = a(n-1)+2*a(n-2)-2*a(n-3)-a(n-4)+a(n-5). - Wesley Ivan Hurt, Apr 21 2021
EXAMPLE
289 = 17^2, 2+8+9 = 19, 1+9 = 1, 1369 = 37^2, 1+3+6+9 = 19, 1+9 = 1.
PROG
(PARI) a(n)=(n\2*9-(-1)^n)^2 \\ Charles R Greathouse IV, Sep 20 2012
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Amarnath Murthy, Apr 19 2001
EXTENSIONS
More terms from Harry J. Smith, Jul 17 2009
STATUS
approved