# Integer solutions to $x^2 + dy^2 = c$

I'm trying to find all integer solutions of an equation $x^2 + dy^2 = c$ with $d,c \in \mathbb{Z}_{>0}$. I'm well aware of the methods that exists when $d \in \mathbb{Z}_{<0}$ or when $c$ is a square. But what if both are not the case? I'm especially interested in the equation $x^2 + 7y^2 = 116$.

I've tried splitting it up in $\mod 29$ and $\mod 4$, but couldn't find all the solutions in $\mod 29$. Any thoughts?

• there is an algorithm for this by Hardy, Muskat, and Williams , Math. Comp (1990). Also, this new book looks interesting, these authors mostly deal with contests books.google.com/… – Will Jagy Aug 24 '15 at 17:49
• meanwhile, $x^2 + 7 y^2 \equiv 4 \pmod 8$ means both $x,y$ are even, divide both by 2 and you just need to solve $u^2 + 7 v^2 = 29,$ which gives $(\pm 1, \pm 2).$ Then go back and double – Will Jagy Aug 24 '15 at 18:20
• if both are odd you get $0 \pmod 8,$ if one is odd and one even you get odd. You should confirm that odd squares are always $1 \pmod 8,$ whatever method will allow you to believe it and remember – Will Jagy Aug 24 '15 at 19:17
• Looked at your earlier questions, definitely recommend Cassels for the Hilbert symbol and related, it is also inexpensive. I have pretty much every book in English on quadratic forms, take my word for it: store.doverpublications.com/0486466701.html – Will Jagy Aug 24 '15 at 19:20
• math.stackexchange.com/questions/268402/… – Will Jagy Aug 24 '15 at 19:29

For this particular equation if $|y|>4$ then $7y^2>116$,also if $|x|>10$ then $x^2>116$(for $x,y$ integers).Now by trial you have that $$(x,y)=(2,4),(-2,4),(2,-4),(-2,-4)$$