OFFSET
0,2
COMMENTS
For a guide to related sequences, see A211422.
From David A. Corneth, May 21 2020: (Start)
Let (w, x, y) be a primitive solution to the 8 solutions {(w, x, y), (-w, x, y), (w, -x, -y), (-w, -x, -y), (w, y, x), (-w, y, x), (w, -y, -x), (-w, -y, -x)}. Then for any n > 1 we have the primitive solution (0, 0, n) giving 4 solutions where abs(max(w, x, y)) = n. For even n we also have (n, 2, (n/2)^2) as a primitive solution. So a(n) - a(n-1) >= 4 for n odd and a(n) - a(n-1) >= 12 for n even and a(n) >= 8*n - 3. (End)
LINKS
Brandon Crofts, Table of n, a(n) for n = 0..20000
Brandon Crofts, Faster Mathematica code for A211423
MATHEMATICA
t[n_] := t[n] = Flatten[Table[w^2 + 2 x*y, {w, -n, n}, {x, -n, n}, {y, -n, n}]]
c[n_] := Count[t[n], 0]
t = Table[c[n], {n, 0, 60}] (* A211423 *)
(t - 1)/4 (* integers *)
PROG
(PARI) first(n) = {n--; my(v = vector(n, i, 4)); forstep(w = 2, n, 2, for(x = 1, n, y = w^2/(2*x); if(denominator(y) == 1 && abs(y) <= n, v[vecmax([x, y, w])]+=4 ) ) ); res = vector(n + 1); res[1] = 1; for(i = 2, n+1, res[i] = res[i-1] + v[i-1]); res } \\ David A. Corneth, May 21 2020
(PARI) first(n) = { my(res = vector(n), d); res[1] = 1; for(i = 1, n-1, t = i\(sqrtint(2*i*core(2*i)))*2+1; if(!bitand(i, 1), d = divisors(i^2/2); t += 2*(vecsearch(d, i) - #d\2 - 1)); res[i+1] = res[i] + 4*t; ); res } \\ faster than PARI above \\ David A. Corneth, May 22 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Apr 10 2012
STATUS
approved