OFFSET
0,4
COMMENTS
Rewriting the expression as (2 x + y)^2 + 4 y^2 facilitates an efficient search without negative terms. - Bert Dobbelaere, Sep 24 2020
REFERENCES
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
D. Shanks and L. P. Schmid, Variations on a theorem of Landau. Part I, Math. Comp., 20 (1966), 551-569.
EXAMPLE
a(4)=4 since 2^4=16 and 4=4*1^2, 5=5*1^2, 13=4*1^2+4*1*1+5*1^2, 16=4*2^2.
PROG
(PARI) a(n)=if(n<0, 0, sum(k=1, 2^n, 0<sum(j=0, sqrtint(k)\2, issquare(k-4*j^2)&(k-j)%2==0)))
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
a(27)-a(39) from Bert Dobbelaere, Sep 24 2020
STATUS
approved