I have a polynomial of the second degree $a\cdot n^2 + b \cdot n + c$ and I need to find out natural numbers $n$, such that $\sqrt{a\cdot n^2 + b \cdot n + c}$ is also a natural number.
After thinking about this problem, my idea was to rewrite it into $a\cdot n^2 + b \cdot n + c = x^2$ and rewrite it to look like a Pell's equation:
$$(2an + b)^2 - 4ax^2= b^2 - 4 ac$$ which kind of resembles $x^2 - n y ^2 = 1$, but not really close enough to for me to solve it.
Then I tried to find some similarities in solutions for particular cases. For example when I took the equation $\sqrt{3\cdot n^2 - 2 \cdot n - 1}$ and wrote the program, the couple of first values were: 1, 5, 65, 901, 12545 (with no visible pattern for me).
So how should I solve this problem?
With slight change of notation, you are looking for, given $a,b,c\in \mathbf{Z}$, points with integer co-ordinates on the curve $ax^2-y^2+bx+c=0$.
This is a conic. If you know one solution exists, then we can find infinitely many through rational parametrization. This is well-known (for example can be found in Silverman-Tate). Call this one solution point $Q_0$
Now fix a line $L$ whose equations has integer/rational coefficients. For a variable point $P\in L$ with RATONAL co-ordinates, write the equation of the line connecting $P$ with $Q_0$; as the intersection of a conic with line has 2 points you get the other point $P'$. This will be a rational point.(Convince yourself). So you get solutions you want.