OFFSET
0,4
COMMENTS
Same as A238872 except a(0) = 0.
LINKS
Wikipedia, Hurwitz class number.
FORMULA
EXAMPLE
G.f. = x + x^2 + 3*x^3 + 2*x^4 + 3*x^5 + 3*x^6 + 4*x^7 + 3*x^8 + ...
MATHEMATICA
a[ n_] := If[ OddQ[n], 1, 1/3] Length @ FindInstance[ {x >= 0, y >= 0, z >= 0, x y + y z + z x + x + y + z + 1 == n}, {x, y, z}, Integers, 10^9];
a[ n_] := Length @ FindInstance[ {1 <= y <= n, 1 <= x <= y, 1 <= z <= y, y^2 - (x^2 - x + z^2 - z) / 2 == n}, {x, y, z}, Integers, 10^9];
PROG
(PARI) {a(n) = my(c, t, i); for(k=1 + sqrtint(max(0, n-1)), n, forstep(j=1, min(2*k, sqrtint(t = 8*k^2 - 8*n + 2)), 2, if( issquare( t - j^2, &i) && i<=2*k, c++))); c};
CROSSREFS
KEYWORD
nonn
AUTHOR
Michael Somos, Jul 18 2015
STATUS
approved