$x,y$ are positive integer . Find all $x,y$ such that $\frac{x^2+y^2}{x-y}|1995$.

My answer: ${x^2+y^2}|1995$. Therefore, $x^2+y^2$ can be $1$, $3$, $5$, $7$, $19$, $15$, $21$, $35$, $57$, $95$, $133$, $105$, $285$, $399$, $665$ or $1\,995$.

I observed that only $5$ can be represented as the sum of two square ( I haven't check the last two number because they are very big).

So, $(x,y)=(1,2),(2,1)$. Am I right?? I believe there is a easier method.I am looking for that. Please help me.

  • $\begingroup$ The sum of two squares theorem and $1995=3 \times 5 \times 7 \times 19$ may get you to $5$ more quickly, since $19 \equiv 7 \equiv 3 \pmod 4$ so none of them can appear once in the divisor. $\endgroup$ – Henry Jul 17 '18 at 12:55
  • $\begingroup$ You might also check that $x^2+y^2=1$ does not give a solution in positive integers $\endgroup$ – Henry Jul 17 '18 at 12:59
  • $\begingroup$ I am looking for any other method. If anyone have please post! $\endgroup$ – Sufaid Saleel Jul 17 '18 at 13:18
  • $\begingroup$ If you insist that the divisor be a positive integer $(1,2)$ doesn't work $\endgroup$ – Ross Millikan Jul 17 '18 at 13:44
  • 2
    $\begingroup$ If $x=1197, y=399$, then $x^2+y^2=1,592,010$, but $\dfrac{x^2+y^2}{x-y}=1995$. $\endgroup$ – InterstellarProbe Jul 17 '18 at 14:13

Your first assertion that $x^2+y^2 \mid 1995$ doesn't follow from your hypotheses. Note that $(6,3)$ and $(38,19)$ are also solutions. Certainly $(x^2+y^2)/(x-y) >1995$ for $x>1995$, so there can be only finitely many solutions. I believe that $(399,1197)$ is the largest.

I observe that if $a=(x^2+y^2)/(x-y)$ and that $(x,y)$ is a solution, then so is $(a-x,y)$.

Edit: I also observe that every solution is of the form $(2y,y)$ or $(3y,y)$ and in all cases $a=5y$.

Another Edit. Let $k$ be a divisor of $1995$. Then you have $x^2+y^2=k(x-y).$ Put everything on one side and complete the square:

$$\left(x-\frac{k}{2}\right)^2+\left(y+\frac{k}{2}\right)^2 = \frac{k^2}{2}.$$

Multiply through by $4$:

$$(2x-k)^2 +(2y+k)^2 = 2k^2.$$

So find, in the usual way, all the ways of writing $2k^2$ as a sum of two squares. Since many of the prime divisors are congruent to $3$ mod $4$, there are not many solutions. Then solve for $x$ and $y$. Do this for each $k$ and you have all solutions. Here's one example. Take $k=35$. So we find all solutions to

$$u^2+v^2 = 2\cdot35^2$$

and these are $(7,49)$ and $(35,35)$. The second one leads to $x=0$, which is not positive. The first one gives $2x-35 = 7$ and $2y+35 = 49$ which leads to $(x,y) = (21,7)$. Then from my observation above $y=35-21 = 14$ gives a second solution. Lather, rinse, repeat for all $k$.


Beautiful number.


Solutions have the form:




  • $\begingroup$ Please include an explanation or derivation for your answer - unjustified claims are much less useful $\endgroup$ – Carl Mummert Jul 28 '18 at 20:55


This list is complete for all pairs in $\{(i,j) \in \mathbb{Z}^2 \mid 1\le i < j \le 30000\}$

I just wrote a small program to find solutions. I figured, having the list of solutions would be a good way to check any answers people come up with, although this is not technically a complete answer, as it does not explain why these are the only pairs that work.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.