Reduced positive definite binary quadratic forms of discriminant minus thirty-five (source code)

= Reduced positive definite binary quadratic forms of discriminant minus thirty-five
{title2=$D=-35$}

At <discriminant of a binary quadratic form> $D=-35$, the <reduced positive definite binary quadratic forms> are exactly
$$
f_1=[1,1,9],\qquad f_2=[3,1,3].
$$
The <enumeration of reduced binary quadratic forms> bound gives $a\leq\sqrt{35/3}<4$. For $a=1,2,3$, the required odd $b$ and the divisibility $4a\mid b^2+35$ leave precisely those two triples after the boundary sign convention. Both are primitive, so $h(-35)=2$.

For a <prime number> $p>7$, $f_1$ represents $p$ exactly when both <Legendre symbols> $(p/5)$ and $(p/7)$ are one; $f_2$ represents $p$ exactly when both are minus one. The square-completion identities
$$
4f_1=(2x+y)^2+35y^2,\qquad12f_2=(6x+y)^2+35y^2
$$
prove the necessary signs <modulo> five and seven: four is a square at both primes, whereas twelve is a <quadratic nonresidue> at both.

For sufficiency, either matching sign pair gives $(-35/p)=(p/5)(p/7)=1$ by <quadratic reciprocity>. The <discriminant criterion for prime representation by a binary quadratic form> then supplies a primitive form of discriminant $-35$ representing $p$. It reduces to one of the two listed forms, and their distinct sign conditions determine which. For example, $11=f_1(1,1)$, whereas $13=f_2(1,-2)$.