# Classifying binary quadratic forms by the set of representable squares

Let $f$ be a positive definite binary quadratic form with integer coefficients. Define

$$\displaystyle S_f = \{n \in \mathbb{N} : \exists (x,y) \in \mathbb{Z}^2 \text{ s.t. } f(x,y) = n^2\}.$$

Clearly, if $g$ is $\operatorname{GL}_2(\mathbb{Z})$-equivalent to $f$, then $S_f = S_g$. Is the converse true? That is, if $S_f = S_g$ and $f,g$ have the same discriminant, does it imply that $f$ and $g$ are $\operatorname{GL}_2(\mathbb{Z})$-equivalent?

No, the set $S_f$ is empty for lots of forms. For example, if $a$ is not a square modulo $b$, then $ax^2+by^2$ is never a square (consider the equation modulo $b$). Thus, $S_f$ is empty for $f(x,y)=6x^2+7y^2$, and also for $g(x,y)=3x^2+14y^2$. Both have the same discriminant, and both are reduced, hence not equivalent.
• Dear @Alex B. , What about if we add up the condition that those sets are nonempty? If $S_f = S_g$ and nonempty, $f,g$ have the same discriminant, does it imply that $f$ and $g$ are $\operatorname{GL}_2(\mathbb{Z})$-equivalent? – Davood KHAJEHPOUR May 22 at 8:55