Sum and number of divisors

If the sum of divisors is prime, how can I show that the number of divisors is also prime? I've tried to use definitons, but I'm not getting anything.

• Do you mean that "if $\sigma(n)$, the sum of all divisors of $n$, is prime, then $d(n)$, the number of divisors of $n$, is prime"? – Lord Shark the Unknown Dec 21 '18 at 4:58
• Do you have any examples of numbers $n$ such that $\sigma(n)$ is prime? I can think of only one such $n.$ – Will Jagy Dec 21 '18 at 5:07
• @WillJagy think Mersenne! – Lord Shark the Unknown Dec 21 '18 at 5:10
• Clearly the numbers with an odd no. of divisors are perfect squares. So we have to show if the sum of the divisors of a perfect square are prime then the no. of divisors is also prime. – Uday Khanna Dec 21 '18 at 6:37
• @LordSharktheUnknown good, found first few 2 = 2 sigma 3 d 2 /// 4 = 2^2 sigma 7 d 3 /// 9 = 3^2 sigma 13 d 3 /// 16 = 2^4 sigma 31 d 5 /// 25 = 5^2 sigma 31 d 3 /// 64 = 2^6 sigma 127 d 7 /// 289 = 17^2 sigma 307 d 3 /// 729 = 3^6 sigma 1093 d 7 – Will Jagy Dec 21 '18 at 18:29

The sum of the divisiors of the number $$N=p_1^{a_1}\cdots p_n^{a_n}$$ is $$(1+p_1+\cdots +p_1^{a_1})\cdots (1+p_n+\cdots +p_n^{a_n})$$ All the factors are greater than $$1$$, so if $$N$$ has more than one prime factor, the sum of the divisors cannot be prime. Hence we can concentrate on the prime powers. For a prime power $$p^n$$ , the sum of divisors is $$\frac{p^{n+1}-1}{p-1}$$ and the number of divisors is $$n+1$$. If $$n+1$$ is composite, let us say $$n+1=ab$$ with $$a,b>1$$ , then $$p^a-1\mid p^{n+1}-1$$ giving the non-trivial factor $$\frac{p^a-1}{p-1}$$. This completes the proof of the statement.