# Finding the sum of values

The number $2001$ can be written in the form of $x^2-y^2$ when $x,y$ are positive integers in four different ways ,then how to find the the sum of $x$ values

-
Is there an argument why you don't brute force it ? –  Dominic Michaelis Mar 10 '13 at 13:54
Self work, ideas, effort...? –  DonAntonio Mar 10 '13 at 13:54
How can there be 4 pairs ? I think there are only 2 –  Amr Mar 10 '13 at 13:59
@DominicMichaelis Anybody brute-forcing this (i.e. not seeing the factorization trick) would be doomed to try arbitrarily large $x,y$. –  Hagen von Eitzen Mar 10 '13 at 14:01
@Amr $2^3/2=4$. –  Hagen von Eitzen Mar 10 '13 at 14:01

Hint: $x^2-y^2=(x-y)(x+y)$ with $0<x-y<x+y$ and $2001$ has which property?

Complete "theory" of this:

For $n\in \mathbb N$, let $$f(n)=\sum_{(x,y)\in\mathbb N^2,\atop x^2-y^2=n} x$$ be the result we are looking for.

Given $n\in\mathbb N$, any solution to $x^2-y^2=n$ with $x,y\in\mathbb N$ determines a divisor $d=x-y$ of $n$ because $n=x^2-y^2=(x-y)(x+y)$. We have $d>0$ because $x-y=\frac n{x+y}>0$ and $d<\sqrt n$ because $x+y>x-y$.

On the other hand, if $n$ is odd, then any positive divisor $d$ of $n$ with $d^2<n$ gives rise to a solution $x-y=d, x+y=\frac nd$, i.e. $x=\frac{d+\frac nd}2$, $y=\frac{\frac nd-d}2$ (note that $\frac nd$ is also odd, hence the numerators are even). If $n$ is even but not a multiple of $4$, then $d$ and $\frac nd$ in the expressions above always have different parity, hence there is no solution. If $n$ is a multiple of $4$, then $d$ and $\frac nd$ must both be chosen even, that is $d$ is a divisor of $\frac n4$. In summary this means

$$f(n)=\begin{cases}\tfrac12\sigma(n)&\text{if }n\text{ odd and not a perfect square},\\ \tfrac12(\sigma(n)-\sqrt n)&\text{if }n\text{ odd and perfect square},\\ 0&\text{if }n\equiv 2\pmod 4,\\ \tfrac12\sigma(\tfrac n4)&\text{if }4|n\text{ and n not a perfect square},\\ \tfrac12\sigma(\tfrac n4)-\frac14\sqrt n&\text{if }n\text{ is an even perfect square}.\end{cases}$$ Here, $\sigma(n)$ denotes the sum of all (positive) divisors of $n$. It is well-known that $$\sigma(n)=\prod_{p|n,\atop p\text{ prime}}\frac{p^{k_p+1}-1}{p-1}\qquad\text{if }n=\prod_{p|n,\atop p\text{ prime}}p^{k_p} .$$

Now find the prime factorization of $n=2001$.

-

Hint: Use $x^2 - y^2 = (x+y)(x-y)$ and the prime factorization of $2001$ to explicitly find the solutions $(x,y)$.

-
It is mentioned that $x$ is a positive integer –  Amr Mar 10 '13 at 13:55
Whoever downvoted this answer rushed too much, even if it is wrong. Give people a little more slack! –  DonAntonio Mar 10 '13 at 13:58
Amr: Thanks. I changed my answer to be of more value, hopefully. –  azimut Mar 10 '13 at 13:59
DonAntonio: Admittedly, I had the same feeling. Thank you for your comment! –  azimut Mar 10 '13 at 14:00
@DonAntonio I agree with you ${}{}{}{}{}{}$ –  Amr Mar 10 '13 at 14:09

Hints:

$$2001=3\cdot667=(x-y)(x+y)\Longrightarrow\begin{cases}x-y=3\\x+y=667\end{cases}$$

...or the other way around and minus signs....

-
Not or the other way round and not minus signs. But we have different options to write $2001=a\cdot b$. –  Hagen von Eitzen Mar 10 '13 at 13:58
Yes the other way around and yes the minus signs: will you please let the OP sort out his/her options alone?! If he wants to rule out something later then he will. –  DonAntonio Mar 10 '13 at 14:05
No reason to get worried - I merely wanted to point out that the OP required $x,y$ to be positive integers, hence minus signs are ruled out, as is letting $x-y$ be the bigger factor. –  Hagen von Eitzen Mar 10 '13 at 14:49
Let him deduce his stuff alone! I also did not include in the hints the rather obvious $\,2001=1\cdot 2001\,$...but if you don't give the OP even 10 minutes to swallow the hint then it doesn't serve him very good, does it? –  DonAntonio Mar 10 '13 at 14:54
Agreed. But then it would maybe have been better to merely write "For example". Adding "or red herring" but silently dropping the really relevant "or" gave me the impression of intended completeness, esp. as swapping order and signs could account for a count of four solutions as requested. Sorry again, and for me eod - before we get expelled from here into chat :) –  Hagen von Eitzen Mar 10 '13 at 15:05