Determine all pairs $(m,n)$ of positive integers such that $m^2+n^2=2018(m-n)$
Problem
Source:
Tags: number theory
09.02.2018 22:45
First, if, $m\not\equiv n \pmod{2}$, $m^2+n^2$ would be odd, contradiction. Thus, $m\equiv n \pmod{2}$, in particular, the right-hand-side is divisible by $4$. Therefore, both $m,n$ are odd, say, $m=2m_1,n=2n_1$, and arrive at, $$ m_1^2+n_1^2 = 1009(m_1-n_1). $$Now, suppose, $d=(m_1,n_1)$, and that, $m_1=da,n_1=db$, for $a,b$ coprime. We get, $$ d(a^2+b^2)=1009(a-b). $$Now, the punchline is as follows. If, $q$ is a prime, dividing $(a^2+b^2,a-b)$, then, $a\equiv b \pmod{q}$, hence, $q\mid 2b^2$. If, $q\mid b$, then, $q\mid a$, contradicting with coprimeness. Hence, $q\nmid b$, thus, $q=2$. Also note that, either, $a,b$ are both odd (therefore, the largest power of $2$, dividing the gcd can be at most 1, since, $a^2+b^2\equiv 2 \pmod{4}$, or, one is odd, the other is even; giving that, their gcd is one). Hence, $(a^2+b^2,a-b)\in \{1,2\}$. Using this, $\bullet$ If, $(a^2+b^2,a-b)=1$, we have, $a^2+b^2 \mid 1009(a-b)\implies a^2+b^2 \mid 1009$. Since $1009$ is a prime, the only possibility is, $a^2+b^2=1009$. This can be done by case bashing, but, to accelerate the process, simply note that, $1009 \equiv 1 \pmod{3}$, exactly one of $a,b$ is divisible by $1009$, and, $a>b$. I got, $(18,25)$ as the only possibility, maybe I've missed a few, not entirely sure; but roughly 10 cases to be eliminated, that is a trivial task. $\bullet$ If, $(a^2+b^2,a-b)=2$, then, $a,b$ are both odd. We have, $a^2+b^2 \mid 2018$. Hence, either, $(a,b)=(1,1)$, or, $a^2+b^2=1009$, or else, $a^2+b^2 = 2018$. For the last case, note that, in modulo $3$, $2018\equiv 2 \pmod{3}$, hence, one of them is of form, $6k+1$ or $6k+5$. Sweeping across these numbers, you can get the second candidate set. Once, $(a,b)$'s are determined as I've sketched above, one can trivially recover $d$, so do, $(m,n)$.
09.02.2018 22:58
$(m-2018)^2+(n+2018)^2=2\cdot2018^2$ $(a+b)^2+(a-b)^2=2\cdot2018^2$ where (a,b,2018) is a pythagorean triple
10.02.2018 07:18
@above it should be \[(m-1009)^2+(n+1009)^2=2\cdot1009^2\]Which becomes: \[(m-n-2018)^2+(m+n)^2=(2018)^2\]
26.05.2022 21:59
it is the same quesiton as Bulgaria Math Olympiad 1998 only diffrence is in that question we solve it for 1998 not 2018 I saw it in one of the turkish olypiad books
08.06.2022 20:08
Solution: Let $m=dx , n=dy, (x,y)=1 , d \in Z^+$. Then we rewrite as $d(x^2+y^2)=2018(x-y)$. Since $(x^2+y^2,x-y)=(x^2+y^2-(x-y)(x+y),x-y)=(2x^2,x-y)$ and by using $(x,x-y)=1$ we have $(x^2+y^2,x-y) \mid 2$ (*). From the equation $d(x^2+y^2)=2018(x-y)$ we have $x^2+y^2 \mid 2018(x-y)$ and from (*) we obtain $x^2+y^2 \mid 4036$. Trivially $x^2+y^2$ cannot be 1,2 or 4. Suppose $x^2+y^2=4036$ them by modulo $8$ we obtain both $x$ and $y$ are odd but this is a contradiction since $(x,y)=1$. We have two cases. $i)$ $x^2+y^2=1009$ $\Rightarrow$ $x=28,y=15$ (just try there are few possibilities) so we get $d=26$ so $x=728,y=240$ $ii)$ $x^2+y^2=2008$ $\Rightarrow$ $x=43,y=13$ so we get $d=30$ so $x=1290,y=390$ and these are the only solutions. $\blacksquare$