# $\frac{x^2+y^2}{x-y}|1995$. Find positive integer $x,y$

$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.

• 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. – Henry Jul 17 '18 at 12:55
• You might also check that $x^2+y^2=1$ does not give a solution in positive integers – Henry Jul 17 '18 at 12:59
• I am looking for any other method. If anyone have please post! – Sufaid Saleel Jul 17 '18 at 13:18
• If you insist that the divisor be a positive integer $(1,2)$ doesn't work – Ross Millikan Jul 17 '18 at 13:44
• If $x=1197, y=399$, then $x^2+y^2=1,592,010$, but $\dfrac{x^2+y^2}{x-y}=1995$. – 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.

$$\frac{x^2+y^2}{x-y}=a$$

Solutions have the form:

$$a=p^2+s^2$$

$$y=s(p-s)$$

$$x=p(p-s)$$

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

$(1,2),(1,3),(3,6),(3,9),(7,14),(7,21),(19,38),(19,57),(21,42),(21,63),(57,114),(57,171),(133,266),(133,399),(399,798),(399,1197)$

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.