# Integer solution to a square root equation

Given the following function: $$f(x) = \sqrt{36 x^2+16416 x +61084}$$ where x is an integer and the function also generates an integer value, is there an algorithm to determine its integer solutions?

-
What do you mean by "solution"? Do you mean the x for which $f(x) =0$? –  DavidButlerUofA Jul 16 '14 at 20:05
Your question is a little unclear: are you asking for solutions to "$f(x) = 0$"? Or "$f(x)$ is an integer"? Or something else? –  Hurkyl Jul 16 '14 at 20:06
The term $72*x*228$ also hints at a typo. –  hardmath Jul 16 '14 at 20:07
Sorry , I can not figure out what to do with the 228 –  bobbym Jul 16 '14 at 20:14
Sorry but the function f(x) generates an integer value. Also 72*x*228 = 16416*x. –  Nominal Jul 16 '14 at 21:00

Given

$$f(x) = \sqrt{ 36 x^2 + 16416 x + 61084}.$$

For what integer $x$ is $f(x)$ also an integer?

We can write

$$f(x) = \sqrt{ \Big( 6 x + 1368 \Big)^2 - 1810340 },$$

therefore

$$\Big( 6 x + 1368 \Big)^2 - 1810340 = \Big( 6 x + 1368 - p \Big)^2,$$

so

$$p \left\{ 2 \Big( 6 x + 1368 \Big) - p \right\} = 1810340.$$

Thus

$$x = \left( \left( \frac{1810340}{p} + p \right) \Big/ 2 - 1368 \right) \Big/ 6.$$

Note the symmetry

$$\frac{1810340}{p} + p = \frac{1810340}{1810340/p} + 1810340/p.$$

Using

$$1810340 = 2^2 \times 5 \times 7 \times 67 \times 193,$$

we can use limited values for $p$, like $p=2 \times 5 \times 7$, which is equivalent with $p= 2 \times 67 \times 193$.

We obtain the following results:

$$\begin{array}{ccccc|c|c} 2 & 5 & 7 & 67 & 193 & p & x\\ \hline \times &&&&& 2 &75203\\ \times & \times &&&& 10 &14859\\ \times && \times &&& 14 &10549\\ \times & \times & \times &&& 70 &1933\\ \times &&& \times && 134 &909\\ \times &&&& \times & 386 &195\\ \times & \times && \times && 670 &53\\ \times & \times &&& \times & 1930 &11\\ \end{array}$$

-

You can write $f(x) = \sqrt{(6(x-228))^2 - 1810340}$.

Now, $f(x)$ is an integer if and only if $(6(x-228))^2 - 1810340$ is a square. Write $$k^2=(6(x-228))^2 - 1810340$$ so $$1810340 = (6(x-228))^2 - k^2 = (6x-6*228+k)(6x-6*228-k)$$

Now you factorize $1810340 = 2^2 * 5* 7* 67* 193$.

So you have to solve $48$ linear systems of the form $$\left\{ \begin{matrix} 6x-6*228&+k &=& a \\ 6x-6*228&-k &=& b \end{matrix} \right.$$

For all possible values of $ab = 1810340$.

-
$f(6195)$ is in fact not an integer (I just plugged it into Wolfram). One potential issue I see with your proof is that $x$ and $k$ are not independent, so you cannot simply solve the last system of equations. –  Divergent Queries Jul 16 '14 at 21:18
No, I did a worse mistake. I made a mistake in completing the square. In fact, if you compute $(3*6195-228)^2-36713$ you get exactly $18356^2$. Ok, sorry, I made a mistake but I'm not erasing my answer. –  Crostul Jul 16 '14 at 21:37
That's fine. Mind if I edit it, though? –  Divergent Queries Jul 16 '14 at 21:39
I am editing right now. –  Crostul Jul 16 '14 at 21:41
It should be $\sqrt{(6(x\color{red}{+}228))^2 - 1810340}$... –  johannesvalks Jul 16 '14 at 21:57