This is a follow up to a question from yesterday regarding the representation of integers by binary quadratic forms with integer coefficients. OEIS A031363 lists the positive integers of the form $x^2+xy-y^2$ which turn out to be the same as those of the form $5x^2-y^2.$ Yesterday's question was how to show the two sets are the same, but I notice that on the OEIS page, it says, under "Formula:
Consists exactly of numbers in which primes == 2 or 3 mod 5 occur with even exponents.
I've been wondering what it takes to prove this, in particular whether it can be shown by elementary methods, since I know no algebraic number theory at all.
I think it's likely to be much easier to prove that numbers not of this form can't be represented than to prove the converse, so I'm starting with that.
For $p=2$ it says, no $n \equiv 2 \pmod 4$ can be so represented, and it's trivial to check that $5x^2-y^2$ cannot be of this form, since the only squares $\pmod 4$ are $0 \text{ and }1.$
For a general attack, I'm thinking about trying to show that $n$ is representable if and only if each of its prime factors is representable. If true, this would reduce the problem to representability of primes. I have some confidence in the "if" part (at least I know that the sum of two squares times the sum of two squares is again the sum of two squares) but I have no feeling for the "only if" part at all. Since $k^2n$ is representable if and only if $n$ is representable (from the form $5x^2-y^2),$ and $1$ is we don't need to consider powers.
This isn't something I need for school or work. I'm retired and sometimes do math for recreation; I want to know if this is a suitable problem for me to work on, that is, one that offers a reasonable chance of success, or at least progress. I'm not asking for a proof; I just want to have some idea of the level of difficulty of the problem.
Suppose $(5|p) = 1$ for prime $p > 10.$ We can solve $$ t^2 \equiv 5 \pmod p. $$ If necessary by switching to $p-t,$ we can arranged that $t$ is odd, in which case we have actually solved $$ t^2 \equiv 5 \pmod {4p}, $$ or $$ t^2 = 5 + 4 p w, $$ $$ t^2 - 4 p w = 5. $$ That means that $$ \langle p,t,w \rangle $$ are the ordered coefficients of a binary quadratic form of discriminant $5.$ By inequaities, we know that this form is $SL_2 \mathbb Z$ equivalent to $ \langle 1,1,-1 \rangle.$ That means there is an integer matrix with determinant $1$ such that $$ \left( \begin{array}{rr} a & c \\ b & d \end{array} \right) \left( \begin{array}{rr} 2p & t \\ t & 2w \end{array} \right) \left( \begin{array}{rr} a & b \\ c & d \end{array} \right) = \left( \begin{array}{rr} 2 & 1 \\ 1 & -2 \end{array} \right) $$ This also means, with all integers, $$ \left( \begin{array}{rr} d & -c \\ -b & a \end{array} \right) \left( \begin{array}{rr} 2 & 1 \\ 1 & -2 \end{array} \right) \left( \begin{array}{rr} d & -b \\ -c & a \end{array} \right) = \left( \begin{array}{rr} 2p & t \\ t & 2w \end{array} \right) $$ meaning $$ d^2 + d (-c) - c^2 = p $$
Here is an example with $p = 241,$ where $103^2 \equiv 5 \pmod {241}$
The matrix called "To Return" tells us that $$ 14^2 + 14 \cdot 9 - 9^2 = 196 + 126 - 81 = 241 $$