count number of a solution of an integer equation

53 Views Asked by At

How to count all couple of strictly positive integers (u,v) such that the following expression also lends an integer?

$$\frac{v}{u}\cdot \left[2v-\sqrt{\left(2v\right)^2-u^2}\right]$$

with \begin{cases}v\leq10^9\\u<2 v\end{cases}

1

There are 1 best solutions below

0
On BEST ANSWER

$$k = \frac vu\left(2v - \sqrt{(2v)^2 - u^2}\right)$$ Note that $k > 0$. Isolating the square root gives $$\frac{2v^2 - ku}v = \sqrt{(2v)^2 - u^2}$$ Which tells us two things. First, that $\frac{2v^2-ku}v > 0$, or since $v > 0$, that $$ku < 2v^2$$ Second, by squaring both sides, $$\frac{4v^4 - 4v^2ku + k^2u^2}{v^2} = 4v^2 - u^2$$ $$\left(\frac {ku}v\right)^2 = 4ku - u^2$$

Since the right side is integer, so is the left, which means that $v \mid ku$. Let $r = \frac {ku}v$, which by the above is an integer with $0 < r < 2v$. Then $$r^2 + u^2 = 4rv$$ Now notice that $4v^2 - u^2 = 4v^2 - 4rv + r^2 = (2v-r)^2$. Which suggests another variable change: let $w = 2v-r$, so $0< w < 2v$. Then $$(2v)^2 = u^2 + w^2$$ Which is an equation whose solutions are well-studied. So I'll leave it to you to trace down the rest (though note that $2$ must also divide $u$ and $w$).