0

Is there any way to know what integer values of $n$ will satisfy

$an^2 + bn + c = x^2$?

In other words, what values of $n$ will make $an^2 + bn + c$ a perfect square, with $a, b, c$ given?

For example, for

$ a = 100, b = 8784, c = 3491 $

we have $n= 127$, then the RHS will be $x^2=1653^2 = 2732409$.

While this example could be done easily with Excel, how can I solve the problem for general $(a,b,c)$?

Ganesh
  • 1,721
  • There are methods , but they are not quite easy. – Peter Jan 09 '22 at 17:39
  • @Peter I can try to learn, if there's any suggested reading (I tried searching on google but I'm not able to find a starting point) – David Solé González Jan 09 '22 at 17:43
  • Here's an example of this kind of question (an easy case, but still might be informative): https://math.stackexchange.com/questions/2272982/if-n24n10-is-a-perfect-square-then-find-the-possible-integer-values-of-n also https://math.stackexchange.com/questions/2972632/find-the-value-of-an-integer-a-such-that-a2-6a-1-is-a-perfect-square and https://math.stackexchange.com/questions/3209340/quadratic-square-values and https://math.stackexchange.com/questions/3325979/how-would-you-find-the-solutions-for-x-where-the-quadratic-27x2234x169-i – Gerry Myerson Jan 09 '22 at 18:39
  • Multiplying by $4a,$ and rearranging, you get the equation $$(2an+b)^2-4a x^2=b^2-4ac$$ That is a “Pell-like equation,” $$u^2-Dv^2=K,$$ with $D=4a, K=b^2-4ac,$ with the added condition $u\equiv b\pmod{2a}.$ Pell-like equations are tricky. The case when $K=1$ or when $a$ is a square are well-understood. But I don’t think we even know a rule for whether solutions exist when $K=-1.$ – Thomas Andrews Jan 09 '22 at 18:46
  • If $a=d^2$ is a perfect square, you have $(u-2dv)(u+2dv)=K,$ so you need a factorization of $K$ as $K=K_1K_2,$ with $K_1\equiv K_2\pmod{4d}$ and $K_1+K_2\equiv 2b\pmod{4a}.$ You can eliminate some cases, when $K$ is not a quadratic residue modulo $4d,$ then there is no solution. But absent such arguments, finding the solutions is as hard as factoring $K.$ – Thomas Andrews Jan 09 '22 at 19:42
  • Hi @Thomas Andrews. Yes, $a$ it's a perfect square. Based on my example, may you please show how to solve it? Would be illustrative for me, thanks – David Solé González Jan 09 '22 at 20:53
  • Why don't you look at all the links I gave, David, where similar examples are solved? – Gerry Myerson Jan 10 '22 at 03:38
  • @Gerry Myerson I took a look (I focused on the second one), but I don't fully understand it, for example it talks about reduced discriminant (I know it comes from a second degree equation), but I cannot figure out what calculation are done... That's why I was asking an example. Sorry if there was some misunderstanding. – David Solé González Jan 10 '22 at 06:28
  • @GerryMyerson I re-checked the 4th link, and there are 2 exposed solutions. Second one it's basically what I did (I don't mean it's a "bad" solution), and on the first one, it's based on the fact that $c = p^2 = 13^2$, so this is not helping... – David Solé González Jan 10 '22 at 17:42

0 Answers0