BMO2 2016 Number Theory Problem

Solution 1:

First assume that $p>2$ (because when $p=2$ the equation $u^2+v^2=8$ is easily solved).

Now use the following trick to form $2p-u-v$ :

$$4p^2=2\cdot 2p^2=2(u^2+v^2)=(u+v)^2+(u-v)^2$$

and use the difference of squares :

$$(2p-u-v)(2p+u+v)=(u-v)^2 $$

Let $q$ be a prime factor of both $2p-u-v$ and $2p+u+v$ so :

$$q \mid (2p-u-v)+(2p+u+v)=4p$$ $$q \mid (2p+u+v)-(2p-u-v)=2(u+v)$$

Now let's consider two cases :

  • If $q$ is odd then $q \mid p$ but because $p$ is prime it follows that $q=p$ and then $p \mid u+v$ .

But then :

$$p \mid (u+v)^2-(u^2+v^2)=2uv$$ $$p \mid uv$$

If for example $p \mid u$ then also $p \mid v$ because $p \mid u+v$ .Thus both $u$ and $v$ are divisible with $p$ and so :

$$2p^2=u^2+v^2 \geq p^2+p^2=2p^2$$

Thus we must have $u=v=p$ and $2p-u-v=0$ is a perfect square .

  • If none of the common prime factors $q$ is odd then their gcd must be a power of two , some $2^k$

Using the identity :

$$(2p-u-v)(2p+u+v)=(u-v)^2 $$

it follows that $2p-u-v=2^kx^2$ and $2p+u+v=2^ky^2$ for some $x$ and $y$ .

Thus if $k$ is even then $2p-u-v$ is a perfect square and if it's odd it's twice a perfect square which proves the claim .

Solution 2:

Hint: One way to get squares from the given $2p-u-v$ is to multiply it by a conjugate, $2p+u+v$. Simplify what you get using the fact that $2p^2 = u^2+v^2$, and look at the factorization of the result. Then consider the possible values for $2p-u-v$ given that factorization.