1.16: Perfect Numbers and Mersenne Primes
- Page ID
- 83350
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)In this chapter we discuss perfect numbers.\(^{1}\)
An integer \(n>1\) is perfect if \(\sigma^\ast(n)=n\); in other words, \(n\) is perfect if it equals the sum of its proper divisors.
An equivalent way to define perfect numbers is as those numbers \(n\) for which \(\sigma(n)=2n\).
The proper divisors of \(6\) are \(1\), \(2\) and \(3\). So \(\sigma^\ast(6)=6\). Therefore \(6\) is perfect.
If you do a search for perfect numbers up to 10,000 you will find only the following perfect numbers: \[\begin{aligned} 6 &=2\cdot 3, \\ 28 &=2^2\cdot 7, \\ 496 &=2^4\cdot 31, \\ 8128 &=2^6\cdot 127.\end{aligned}\] Note that \(2^2=4\), \(2^3=8\), \(2^5=32\), \(2^7=128\) so we have: \[\begin{aligned} 6 &=2 \cdot (2^2-1), \\ 28 &=2^2\cdot(2^3-1), \\ 496 &=2^4\cdot(2^5-1), \\ 8128 &=2^6\cdot(2^7-1).\end{aligned}\] Note also that \(2^2-1\), \(2^3-1\), \(2^5-1\), \(2^7-1\) are Mersenne primes. One might conjecture that all perfect numbers follow this pattern. We discuss to what extent this is known to be true. We start with the following result.
If \(2^p-1\) is a Mersenne prime, then \(2^{p-1}\cdot(2^p-1)\) is perfect.
Proof
Write \(q=2^p-1\) and let \(n=2^{p-1}q\). If \(q\) is a Mersenne prime, then since it is odd and prime, by Theorem 1.15.1(2) we have \(\sigma(n)=\sigma\left(2^{p-1}q\right)=\left(\frac{2^p-1}{2-1}\right) \left(\frac{q^2-1}{q-1}\right)=(2^p-1)(q+1) = (2^p-1)2^p = 2n\). That is, \(\sigma(n) = 2n\) and \(n\) is perfect.
Now we show that all even perfect numbers have the conjectured form.
If \(n\) is even and perfect then there is a Mersenne prime \(2^p-1\) such that \(n=2^{p-1}(2^p-1)\).
Proof
Let \(n\) be even and perfect. Since \(n\) is even, \(n=2m\) for some \(m\). We take out as many powers of \(2\) as possible, obtaining \[n=2^k\cdot q,\quad k\ge 1\text{, $q$ odd}.\nonumber \] Since \(n\) is perfect, \(\sigma^\ast(n)=n\), that is, \(\sigma(n)=2n\). Since \(q\) is odd, \(\gcd(2^k,q)=1\), so by Lemmas 1.15.1 and 1.15.2, \[\sigma(n)=\sigma(2^k)\sigma(q)=(2^{k+1}-1)\sigma(q).\nonumber \] So we have \[2^{k+1}q=2n=\sigma(n)=(2^{k+1}-1)\sigma(q),\nonumber \] hence \[\label{eq: thm 16-2 first} 2^{k+1}q=(2^{k+1}-1)\sigma(q).\] Now \(\sigma^\ast(q)=\sigma(q)-q\), so \[\sigma(q)=\sigma^\ast(q)+q.\nonumber \] Putting this in equation \(\eqref{eq: thm 16-2 first}\) we get \[2^{k+1}q=(2^{k+1}-1)(\sigma^\ast(q)+q)\nonumber \] or \[2^{k+1}q=(2^{k+1}-1)\sigma^\ast(q)+2^{k+1}q-q,\nonumber \] which implies \[\label{eq: thm 16-2 second} \sigma^\ast(q)(2^{k+1}-1)=q.\] In other words, \(\sigma^\ast(q)\) is a divisor of \(q\). Since \(k\ge 1\) we have \(2^{k+1}-1\ge 4-1=3\). So \(\sigma^\ast(q)\) is a proper divisor of \(q\). But \(\sigma^\ast(q)\) is the sum of all proper divisors of \(q\). This can only happen if \(q\) has only one proper divisor. This means that \(q\) must be prime and \(\sigma^\ast(q)=1\). Then equation \(\eqref{eq: thm 16-2 second}\) shows that \(q=2^{k+1}-1\). So \(q\) must be a Mersenne prime and \(k+1=p\) is prime. So \(n=2^{p-1}(2^p-1)\), as desired.
There is a one-to-one correspondence between even perfect numbers and Mersenne primes.
Even knowing of the strong connection between perfect numbers and Mersenne primes, a number of well-known questions remain.
- Are there infinitely many perfect numbers?
- Are there any odd perfect numbers?
Of course showing that there are infinitely many Mersenne primes would answer the first question.
So far no one has found a single odd perfect number. It is known that if an odd perfect number exists, it must be \(>10^{50}\).
The idea of a perfect number is pretty old, as is the result of Theorem \(\PageIndex{1}\). Euclid’s Elements\(^{2}\) defines perfect numbers at the beginning of Book VII, and a proof that Mersenne primes can be used to build the even perfect numbers appears as Proposition 36 in Book IX. Of course, Euclid’s use of “Mersenne” primes dates to about 1800 years before Mersenne was born, so he didn’t use exactly that terminology (or our modern algebraic notation), but the ideas are similar and worth a read.
Some even think that Euclid’s knowledge that \(2^{p-1}(2^p-1)\) is perfect when \(2^p-1\) is prime may have been his motivation for defining prime numbers.
Exercises
Use the definition of perfect numbers to determine which of the following numbers are perfect, showing your work.
- \(n=28\)
- \(n=32\)
- \(n=128\)
- \(n=496\)
- \(n=900\)
- \(n=1024\)
- \(n=8128\)
Prove that if \(n\) is a perfect number, then \(\displaystyle\sum_{d \mid n} \frac{1}{d} = 2,\) where the sum is over positive divisors \(d\) of \(n\).
(Hint: If you cleared the denominators in this equation, what would the equation look like?)
- Using results from this chapter, show that if \(M\) is a Mersenne prime, then \(\frac{1}{2}M(M+1)\) is a perfect number.
- Show that if \(M\) is a Mersenne prime, then the sum \[1+2+3+\dots + M\nonumber \] is a perfect number. (Hint: use part (a), and if necessary, look at the formula in Exercise 1.3.3.)
The next two exercises show that the sets of perfect squares (numbers of the form \(n^2\)) and of perfect numbers do not overlap.
Show that if \(n\) is odd, then \(n^2\) is not perfect.
(Hint: Compare the parities of \(n^2\) and \(\sigma^*(n^2)\).)
Footnotes
[1] Note that our usage of "perfect" here and the expression "perfect square" elsewhere in the text are unrelated; squares of integers are never perfect numbers (see Exercises \(\PageIndex{4}\) and \(\PageIndex{5}\) at the end of the chapter), so there is no perfect perfect square!
[2] Remember that we've already come across Elements in Sections 1.8 and 1.11 and 1.12. This ancient text definitely contains some gems!