Find all natural numbers $x$ and $y$ such that $x^2+6xy+y^2$ is a square number.
For example, $(x,y)=(2,3)$ or $(x,y)=(3,10)$.
Obviously, we can consider $gcd(x,y)=1$.
Find all natural numbers $x$ and $y$ such that $x^2+6xy+y^2$ is a square number.
For example, $(x,y)=(2,3)$ or $(x,y)=(3,10)$.
Obviously, we can consider $gcd(x,y)=1$.
On
For non-trivial cases, $xy\ne0$
Let $x^2+6xy+y^2=(x+ky)^2$ where $k$ is any integer
$\iff y(6x+y)=y(2kx+k^2y)\implies6x+y=2kx+k^2y\iff x(6-2k)=y(k^2-1)$
So, $\dfrac x{k^2-1}=\dfrac y{6-2k}=m$(say an integer)
As $x,y>0$ if $m<0,$ we need $6-2k<0\iff k>3\ \ \ \ (1)$ and $k^2-1<0\iff -1<k<1\ \ \ \ (2)$
There can be no $k$ satisfying both $(1),(2)$
Similarly if $m>0,$ we need $6-2k>0\iff k<3$ and $k^2-1>0\iff k>1$ or $k<-1$
$k<3,k<-1\implies k<-1$
or $k<3,k>1\implies1<k<3\implies k=2$
So, there are infinitely natural values of $x,y$
Stereographic projection from $(-1,0),$ I get $$ x = m^2 - n^2, \; \; y = 2 mn + 6 n^2, $$ with $$ \gcd(m,n) = 1, $$ and either $m > n > 0$ or $n < 0$ and $|n| < m < 3 |n|. $ Also $m,n$ not both odd.
Put the inequalities together, we get $$ m > n > 0 \; \; \mbox{OR} \; \; \frac{-m}{3} >n > -m. $$ In the latter case we are originally in the third quadrant as the rational point on the hyperbola $x^2 + 6xy+y^2 = 1$ is $$ x= \frac{m^2 - n^2}{m^2 + 6 mn+n^2}, \; \; y= \frac{2mn+6n^2}{m^2 + 6 mn+n^2}, $$ while $-m/3 > n > -m$ implies $m^2 + 6 mn + n^2 < 0.$
Improvement: If $m,n$ both odd, take $$ x = \frac{m^2 - n^2}{4}, \; \; y = \frac{2 mn + 6 n^2}{4}, $$ final requirement here is that $m \neq n \pmod 4.$ Put another way: when both are odd, we require that $m+n$ be divisible by $4.$
The nonsense with the possible negative signs comes from the fact that we are not projecting onto an ellipse, we are projecting onto a hyperbola. So, the denominator may come up negative and solutions disappear. Need to allow $n$ negative. Let me know if I have missed any solutions; fairly easy to just splat a formula on the page, harder to figure out whether one has all solutions.
Note that, given some pair $(x,y)$ such that $x^2 + 6 xy+ y^2 = w^2$ for some $w,$ we get new pairs ( same $w$) with $$ (-y,x+6y), $$ $$ (-x-6y,6x+35y), $$ $$ (-6x-35y,35x+204y), $$ $$ (-35x-204y,204x+1189y) $$ and so on, which pushes along the relevant hyperbola in the second or fourth quadrant. As you will see, there is some repetition below. First ordered by $m,n$ then a short thing ordered by just $x,y.$
EDIT: this worked out very well. I just restricted to those solutions with $x>y$ and put them in order, well, backwards...Being in order, I was able to compare with a list of all solutions with $x \leq 306,$ we have a winner.
I was curious about repetition, still with positive $x,y,$ to $x^2 + 6 xy+ y^2 = z^2.$ Plenty, and predictable, squarefree products of primes $p \equiv \pm 1 \pmod 8.$