I want to find all integer solutions of the equation $$x^2-7y^2=-3$$ I don't really know where to start... I tried the one trick I know which is to factor in some quadratic ring: $$(x+\sqrt{-3})(x-\sqrt{-3})=7y^2$$ But I don't think that this tells us much since $\mathbb{Z}[\sqrt{-3}]$ is not a UFD. Any help would be appreciated.
I will add that I'll have to solve this type of problem on an exam, hence I want a solution that it quick and suited for use on exams.
As Dietrich is saying:
there is a trick in the style of an infinite descent: for each "non-seed" solution $(x,y),$ both positive, we may find an earlier positive solution by inverting the action Dietrich gives. That is, we back up with $$ (x,y) \mapsto (8x - 21 y, -3x + 8y). $$ A "seed" solution is when either $8x - 21 y \leq 0$ or $-3x + 8y \leq 0.$
I should add that, as $|-3|$ is prime, we get at most two "seed" solutions. I wrote this program to emphasize positive $x,y,$ however, note $ (5,2) \mapsto (-2, 1). $ There is a 2016 article by Brillhart that gives detail on why more than two such seed points would cause the target number to be composite. So, being able to guess the solutions $(\pm 2,1),$ we know we have found all the orbits of solutions.
In addition, since the trace of the "Automorph" matrix is $16,$ but there are two seeds so we alternate,
$$ x_{n+4} = 16 x_{n+2} - x_n, $$ $$ y_{n+4} = 16 y_{n+2} - y_n. $$