Find all positive integers $n$ for which $s(n)=5$.

elementary-number-theorysolution-verification

Question: For each positive integer $n$, let $s(n)$ denote the number of ordered pairs $(x,y)$ of positive integers for which $$\frac{1}{x}+\frac{1}{y}=\frac{1}{n}.$$ Find all positive integers $n$ for which $s(n)=5$.

Solution: Select any $n\in\mathbb{N}$. Let $x,y\in\mathbb{Z^+}$ be such that $$\frac{1}{x}+\frac{1}{y}=\frac{1}{n}.$$ Next assume that $n=p_1^{\alpha_1}p_2^{\alpha_2}\cdots p_k^{\alpha_k}$, where $p_1,p_2,\cdots, p_k$ are distinct primes and $\alpha_1, \alpha_2,\cdots, \alpha_k$ are non-negative integers. Thus $n^2=p_1^{2\alpha_1}p_2^{2\alpha_2}\cdots p_k^{2\alpha_k}.$ Hence the total number of positive divisors of $n^2$ is equal to $(2\alpha_1+1)(2\alpha_2+1)\cdots(2\alpha_k+1).$

From the previous equation we have $$n(x+y)=xy\\\implies xy-nx+n^2-ny=n^2\\\implies(x-n)(y-n)=n^2.$$

Now since $x,y\in\mathbb{Z^+}$, implies that $\frac{1}{x},\frac{1}{y}<\frac{1}{n}$, which in turn implies that $x-n>0$ and $y-n>0$.

Next observe that corresponding to each positive divisor $d$ of $n^2$, we have an unique pair $(x,y)=(d+n,n^2/d+n)$ which is a solution to the equation $\frac{1}{x}+\frac{1}{y}=\frac{1}{n}$. We obtain such pairs by solving equations of the form $$\begin{cases} x-n=d \\ y-n=\frac{n^2}{d} ,\end{cases}$$ for each positive divisor $d$ of $n^2$.

Thus, we can conclude that for some $n\in\mathbb{N},$ $\frac{1}{x}+\frac{1}{y}=\frac{1}{n},$ where $x,y\in\mathbb{Z^+}\iff (x,y)=(d+n,n^2/d+n)$, for some $d\in \mathbb{Z^+}$, such that $d|n^2$.

Hence, the total number of solutions $(x,y),$ given by $s(n)=(2\alpha_1+1)(2\alpha_2+1)\cdots(2\alpha_k+1).$

Thus, $s(n)=5\iff (2\alpha_1+1)(2\alpha_2+1)\cdots(2\alpha_k+1)=5\iff $exactly one of the $a_i's=2$ and the rest are equal to $0\iff n=p^2,$ for any prime $p$.

Thus, we can finally conclude that $s(n)=5\iff n=p^2,$ for any prime $p$.

Is this solution correct and rigorous enough? And, is there any other way to solve the same?

Best Answer

This is correct, perfectly rigorous, and is indeed the canonical way to solve the question. The key step, of course, is the factorisation into $$(x-n)(y-n)=n^2$$

I don't know of any other ways to do this question; I suspect that any other simple solution which works will be this one in disguise.

Related Question