OFFSET
0,2
COMMENTS
An indefinite quadratic form in two variables over the integers, A*x^2 + B*x*y + C*y^2 with discriminant D = B^2 - 4*A*C > 0, 0 or 1 (mod 4) and not a square, is called Zagier-reduced if A>0, C>0, and B>A+C.
This definition is from Zagier's 1981 book, and differs from the older and more common notion of reduced form due to Lagrange (see A082175 for this definition).
A form is primitive if its coefficients are relatively prime.
REFERENCES
D. B. Zagier, Zetafunktionen und quadratische Körper, Springer, 1981.
EXAMPLE
For D=20, the a(5)=4 Zagier-reduced are x^2+6*x*y+4*y^2, 4*x^2+6*x*y+y^2 4*x^2+10*x*y+5*y^2, and 5*x^2+10*x*y+4*y^2.
MATHEMATICA
Table[Length[
Select[Flatten[
Select[
Table[{a, k}, {k,
Select[Range[Ceiling[-Sqrt[n]], Floor[Sqrt[n]]],
Mod[# - n, 2] == 0 &]}, {a,
Select[Divisors[(n - k^2)/4], # > (Sqrt[n] - k)/2 &]}],
UnsameQ[#, {}] &], 1],
GCD[#[[1]], #[[2]] +
2*#[[1]], #[[1]] + #[[2]] - (n - #[[2]]^2)/(4*#[[1]])] == 1 &]], {n,
Select[Range[
153], ! IntegerQ[Sqrt[#]] && (Mod[#, 4] == 0 || Mod[#, 4] == 1) &]}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Barry R. Smith, Apr 17 2015
STATUS
approved