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.
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
Conjecture: a(n)=(9*n-8)^2/4 for n even. a(n)=(9*n-1)^2/4 for n odd. G.f.: x*(16+9*x+112*x^2+9*x^3+16*x^4)/((1-x)^3*(1+x)^2). - Colin Barker, Apr 21 2012
Conjecture is true, because x^2 == 7 (mod 9) if and only if x == 4 or 5 (mod 9). - Robert Israel, Jan 31 2017
EXAMPLE
1681=41^2, 1+6+8+1 = 16, 1+6 =7, 4624=68^2, 4+6+2+4 = 16, 1+6 =7.
MAPLE
seq(seq((9*i+j)^2, j=4..5), i=0..100); # Robert Israel, Jan 31 2017
PROG
(PARI) b=0; for (n=1, 1000, until (s==7, b++; s=b^2; s-=9*(s\9)); write("b061101.txt", n, " ", b^2)) \\ Harry J. Smith, Jul 18 2009
(PARI) a(n)=(n\2*9-4*(-1)^n)^2 \\ Charles R Greathouse IV, Sep 21 2012
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Amarnath Murthy, Apr 19 2001
EXTENSIONS
More terms from Harry J. Smith, Jul 18 2009
STATUS
approved