OFFSET
1,1
LINKS
Harry J. Smith, Table of n, a(n) for n = 1..1000
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.
FORMULA
From Colin Barker, Feb 18 2013: (Start)
Conjecture:
a(n) = (16-72*n+81*n^2)/4 for n even;
a(n)=(25-90*n+81*n^2)/4 for n odd;
g.f.: -x*(4*x^4+45*x^3+64*x^2+45*x+4) / ((x-1)^3*(x+1)^2). (End)
Conjecture is true since x^2 == 4 (mod 9) if and only if x == 2 or 7 (mod 9). The odd-numbered terms are (2+9*k)^2 and the even-numbered terms are (7+9*k)^2. - Robert Israel, Jun 13 2018
EXAMPLE
256 = 16^2, 2 + 5 + 6 = 13, 1 + 3 = 4;
1849 = 43^2, 1 + 8 + 4 + 9 = 22, 2 + 2 = 4.
MAPLE
seq(seq((a+9*k)^2, a=[2, 7]), k=0..20); # Robert Israel, Jun 13 2018
MATHEMATICA
fdsQ[n_]:=NestWhile[Total[IntegerDigits[#]]&, n, #>9&]==4; Select[Range[ 200]^2, fdsQ] (* Harvey P. Dale, Dec 15 2011 *)
PROG
(PARI) a(n)=(n\2*9-2*(-1)^n)^2 \\ Charles R Greathouse IV, Sep 21 2012
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Amarnath Murthy, Apr 19 2001
EXTENSIONS
More terms from Harry J. Smith, Jul 18 2009
STATUS
approved