# Pell type equation: $x^2-py^2=a$

Let $p=4k+1$ be a prime number such that $p=a^2+b^2$, where $a$ is an odd integer.Prove that the equation $$x^2-py^2=a$$ has at least a solution in $\mathbb{Z}$.

-
A standard way to find $a,b$ begins by expanding $\sqrt p$ in a continued fraction; if you stop halfway through the period of the continued fraction, somehow you get $a$ and $b$. I bet solving $x^2-py^2=a$ is related to this. Sorry I can't be more precise. –  Gerry Myerson Aug 5 '12 at 23:39
$p=13$, $a=3$, $x=4$, $y=1$. –  SiliconCelery Aug 6 '12 at 0:07
@Sil, I think the idea was to prove that for every such $p$ there's at least one solution. –  Gerry Myerson Aug 6 '12 at 5:27
@GerryMyerson, Ah, in my defence, that wasn't made very clear. –  SiliconCelery Aug 6 '12 at 10:47

See e.g. Gary Walsh, On a question of Kaplansky".

-
The Albanian Journal of Mathematics! –  Gerry Myerson Aug 6 '12 at 7:28
Thank you, Franz. I remember Kap corresponding with Mollin about a bunch of conjectures, Mollin sent a short pdf with a proof of one of them, I had not realized Mollin published them(2001). Campus has C.R...Canada in bound volumes, but no scan and post service in this case, I will need to go borrow the actual volume and do my own copying. –  Will Jagy Aug 6 '12 at 21:52
Abstract here: mr.math.ca/Vol_23/No_2.html –  Will Jagy Aug 7 '12 at 19:29