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?
$\endgroup$ 52 Answers
$\begingroup$If you wish to have an infinite number of integer solutions to,
$$an^2+bn+c = d^2\tag1$$
but not necessarily all of them, then one way is, yes, to solve a Pell equation. First, as pointed out in the other answer, you need a initial solution. Second, if you limit it to only integers, then $a$ must not be a square.
Given an initial $n,d$ to $(1)$, then an infinite more can be found as,
$$ax^2+bx+c = (-d+py)^2$$
where,
$$x = n+qy$$
$$y = 2dp+(b+2an)q$$
and $p,q$ solve the Pell equation $p^2-aq^2 = 1$.
Example:
$$3n^2-2n-1 = d^2$$
with initial $n,d = 5,8$, you get,
$$3x^2-2x-1 = (-8+py)^2$$
where,
$$x = 5+qy$$
$$y = 16p+28q$$
and $p,q$ is any solution to $p^2-3q^2=1$.
Note: This is an easy method to get an infinite number of solutions, but not all of them.
$\endgroup$ 2 $\begingroup$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.
$\endgroup$