Pell Equations: $a^2+4=5b^2$

This is a challenge problem in the Pell Equations chapter of my number theory book, but I'm not seeing the connection to Pell Equations. The Pell Equation with the coefficient $5$ is $5b^2+1=a^2$, but it doesn't look like the one I have.

Thanks if you can help me.

• The connection is similar to that of homogeneous and in-homogeneous linear equations, but instead of adding you multiply. If you have a solution of your equation $a^2-5b^2=-4$ and solutions of $A^2-5B^2=1$ then you can multiply the two equations $-4=-4\cdot1=(a^2-5b^2)(A^2-5B^2)=(aA+5bB)^2-5(bA+aB)^2$ andget more solutions of your equation. – Carol Feb 10 '15 at 18:41
• @Carol: Sorry if I didn't understand something, but my equation is $a^2-5b^2=-4$ not $a^2-5b^2=4$. Thanks for your reply! – user45220 Feb 10 '15 at 18:44
• I missread. But it is the same idea. Just put a $-4$ where I wrote $4$. – Carol Feb 10 '15 at 18:45
• maybe help :$$a^2+4=5b^2\\a^2-b^2=4b^2-4\\(a-b)(a+b)=4(b^2-1)\\(a-b)(a+b)=4(b-1)(b+1)$$ – Khosrotash Feb 10 '15 at 18:54
• – Will Jagy Feb 10 '15 at 19:36

if a,b are natural numbers :$$a-b<a+b\\(a-b)(a+b)=4(b-1)(b+1)=\\1*(4(b-1)(b+1)\\=2*2(b-1)(b+1)\\=(b-1)*(4(b+1)\\=(b+1)*(4(b-1))\\=2(b-1)*(2(b+1))$$now try them to get answer
\begin{align} a^2+4&=5b^2 \\ a^2-5b^2&=-4 \quad \text{initial solution} \quad (a_1, b_1) =(1,1)\\ (a-b \sqrt5)(a+b \sqrt 5)&=-4\\ \text{since} \quad &(1-\sqrt 5)(1+\sqrt 5)=-4 \\ \text{then} \quad &(1-\sqrt 5)^2(1+\sqrt 5)^2=(-4)^2 \\ &(6-2 \sqrt 5)(6+2 \sqrt 5)=4^2 \quad \text{and}\\ (a-b \sqrt5)(6-2 \sqrt 5)(a+b \sqrt 5)(6+2 \sqrt 5)&=-4^3\\ (6a+10b)^2-5(2a+6b)^2&=-4^3 \\ \left(\frac{3a+5b}{2}\right)^2-5\left(\frac{a+3b}{2}\right)^2&=-4 \implies\\ &\begin{cases} a_{k+1}=\frac{1}{2}(3a_k+5b_k) \\ b_{k+1}= \frac{1}{2}(a_k+3b_k)\end{cases}\\ &\implies \\ &(1,1) \to (4,2) \to (11, 5) \to (29, 13) \to \cdots \end{align}