How do you get the inverse Euclid equation for perfect numbers?

18 Views Asked by At

Any number is a perfect number if It's equal to the sum of all Its divisors except itself. For example, 28 is a perfect number because 1 + 2 + 4 + 7 + 14 = 28. According to Euclid, the set of all perfect numbers are obtained by the following formula:

2^(p-1) * (2^p - 1)

Where p and 2^p - 1 should be prime.

However, if we use a function like f: P -> N, where P is the set of 2^p - 1 prime numbers, and N is the set of all perfect numbers, how would you obtain the inverse function f^-1: N -> P? For example, f^-1(28) = 3, because:

2^2 * (2^3 - 1) = 28

Trying to isolate the p variable via logarithms seems impossible, so I'm stuck here. Is there any way to solve this?

(Sorry for my english)

1

There are 1 best solutions below

0
On

I believe you're trying to solve the equation $2^{p-1}(2^p-1) = N$ for $p$. While this looks almost hopeless, we can exploit a coincidence by writing the equation as \begin{align*} 2^p(2^p-1) &= 2N \\ (2^p)^2 - 2^p - 2N &= 0, \end{align*} for which the quadratic formula gives the solutions \begin{align*} 2^p &= \frac{1\pm\sqrt{1+8N}}{2}. \end{align*} Since $2^p$ must be positive, we conclude that \begin{align*} 2^p &= \frac{1+\sqrt{1+8N}}{2} \\ p &= \log_2 \frac{1+\sqrt{1+8N}}{2} = \log_2 \bigl( 1+\sqrt{1+8N} \bigr) - 1. \end{align*} (By the way, these calculations are valid regardless of whether $N$ is a perfect number, whether $p$ is a prime, or indeed whether they are integers at all—they are valid for all real numbers $p$ and $N$.)