Solving the nonlinear Diophantine equation $x^2-3x=2y^2$

Multiply through by $4$ and complete the square, $(2x-3)^2 - 8 y^2 = 9,$ so that $(2x-3)^2 + y^2 \equiv 0 \pmod 3.$ It follows that both $(2x-3)$ and $y$ are divisible by $3,$ therefore $x$ as well. Write $x=3t, y=3v.$ So far $(2t-1)^2 - 8 v^2 = 1.$ Let $u=2t-1,$ so $u^2 - 8 v^2 = 1.$

...if we write $$ x = \frac{3(1+u)}{2} $$ and $$ y = 3v, $$ we get $$ u^2 - 8 v^2 = 1. $$ This gives a sequence of pairs, $u=1,3,17,99,...$ and $v=0,1,6,35...$

see https://oeis.org/A001541 and https://oeis.org/A001109

These obey $$ u_{n+1} = 3 u_n + 8 v_n, $$ $$ v_{n+1} = u_n + 3 v_n. $$ By Cayley-Hamiton $$ u_{n+2} = 6 u_{n+1} - u_n, $$ $$ v_{n+2} = 6 v_{n+1} - v_n. $$ Then

$$ x_{n+2} = 6 x_{n+1} - x_n - 6, $$ $$ y_{n+2} = 6 y_{n+1} - y_n. $$ The (non-negative) $(x,y)$ pairs begin $$ (3,0) $$ $$ (6,3) $$ $$ (27,18) $$ $$ (150,105) $$ $$ (867,612) $$ $$ (5046,3567) $$


I'll solve it in integers instead. $x^2-3x=2y^2$, by the quadratic formula, is equivalent to

$$x=\frac{3\pm\sqrt{9+8y^2}}{2}$$

So i.e. the problem is equivalent to solving $8y^2+9=m^2$ in integers.

$8y^2\equiv m^2\pmod{3}$, so $(y,m)=\left(3y_1,3m_1\right)$ for some $y_1,m_1\in\Bbb Z$, because $h^2\equiv \{0,1\}\pmod{3}$ for any integer $h$.

The problem is equivalent to $m_1^2-8y_1^2=1$ with $m_1,y_1\in\Bbb Z$. This is a Pell's Equation and has infinitely many solutions given exactly by $\pm\left(3+\sqrt{8}\right)^n=x_n+y_n\sqrt{8}$ for $n\ge 0$ (because $(m_1,y_1)=(3,1)$ is the minimal non-trivial solution), so for example $\pm\left(3+\sqrt{8}\right)^2=\pm17\pm6\sqrt{8}$ and $(m_1,y_1)=(\pm 17,\pm 6)$ is another solution.

In general, Pell's Equation $x^2-dy^2=1$ with $d$ not a square has infinitely many solutions; which are given exactly by $\pm\left(x_m+ y_m\sqrt{d}\right)^n=x_n+y_n\sqrt{d}$, $n\ge 0$, where $(x_m,y_m)$ is the minimal solution, i.e. the solution with $x_m,y_m$ positive integers and minimal value of $x_m+ y_m\sqrt{d}$.


It is evident that equation.

$$x^2-3x=2y^2$$

This is a Pell equation. And we have to use solutions which are determined by the sequence. The next value from the previous one.

$$p_2=3p_1+4s_1$$

$$s_2=2p_1+3s_1$$

If we use the sequence where the first number. $(p_1 ;s_1) - (1 ; 1)$

Decisions will be.

$$x=6s^2$$

$$y=3ps$$

If we use the sequence where the first number. $(p_1 ;s_1) - (3 ; 2)$

Decisions will be.

$$x=3p^2$$

$$y=3ps$$