Find the lowest Integer value for a sqrt of a function where the input x and f(x) must be integers

53 Views Asked by At

For this given equation:

$f(x)=\sqrt{x^2+2bx-c}, x\in\Bbb{Z}$

Where $b, c$ are known, and I know that $x>=1$ I want to find the lowest value for $x$ such that $f(x)\in\Bbb{Z}$.

In other words I want to find an integer value for $x$ to give me a an integer value in $f(x)$.

The numbers $b,c$ have both at least 50 digits, in most cases (if not all) we have $2b>c$.

My question is:

1- Is it possible to find the solution in a direct mathematical way to get the integer value given that the number is large.

2- If not, then is there an algorithm to find the solution in sub polynomial time like: $\log(b)+\log(c)$, if not then what is next best thing?

1

There are 1 best solutions below

0
On BEST ANSWER

To summarize the discussion in the comments:

We can remove the linear term on the right as by writing $x^2+2bx-c=(x+b)^2-b^2+c$. In this way, the problem comes down to seeking pairs of integers $(n,m)$ with $$n^2=m^2+C$$ for some known integer $C$.

But that's equivalent to $$(n-m)(n+m)=C$$

In this way we see that there will be only finitely many solutions $n,m$ as each solution corresponds to a way to write $C=a\times b$ where $a,b$ have the same parity. Conversely, each such factoring gives you a solution $(n,m)$ so, in this way, the problem comes down to factoring $C$. Of course, for very large $C$, this might not be easy.