# Perfect numbers and primes

**URL:** <https://boards.straightdope.com/t/perfect-numbers-and-primes/801016>\
**Category:** Factual Questions\
**Created:** [November 8, 2017, 2:52am UTC](https://boards.straightdope.com/t/perfect-numbers-and-primes/801016 "2017-11-08T02:52:45Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Enola\_Straight](https://avatars.discourse-cdn.com/v4/letter/e/dec6dc/32.png) [@Enola\_Straight](https://boards.straightdope.com/u/Enola_Straight)\
**Post date:** [November 8, 2017, 2:52am UTC](https://boards.straightdope.com/t/perfect-numbers-and-primes/801016/1 "2017-11-08T02:52:45Z")

</div>

Yes…yet another prime number thread from Enola Straight.  
:rolleyes:

It is an established fact that all primes, except 2 and 3, are of the form 6x + or -1.

(bold is prime, underline is composite)

**5** …6… **7**  
**11** …12… **13**  
**17** …18… **19**  
**23** …24…25  
**29** …30… **31**  
35…36… **37**  
**41** …42… **43**  
**47** …48…49  
**53** …54…55  
**59** …60… **61**

It occurred to me that 6 is a perfect number.

> **[Perfect number](https://en.wikipedia.org/wiki/Perfect_number)**
>
> In number theory, a perfect number is a positive integer that is equal to the sum of its positive divisors, excluding the number itself. For instance, 6 has divisors 1, 2 and 3 (excluding itself), and 1 + 2 + 3 = 6, so 6 is a perfect number.
> The sum of divisors of a number, excluding the number itself, is called its aliquot sum, so a perfect number is one that is equal to its aliquot sum. Equivalently, a perfect number is a number that is half the sum of all of its positive divisors including it...

Is there a link between perfect numbers and primes?

27…28… **29**  
55…56…57  
**83** …84…85  
111…112… **113**  
**139** …140…141  
**167** …168…169  
195…196… **197**  
**223** …224…225  
**251** …252…253  
279…280… **281**

Seems there’s quite a few 28x + or -1 primes.

495…496…497  
**991** …992…993  
**1487** …1488… **1489**  
**1983** …1984…1985  
**2479** …2480…2481  
2975…2976…2977  
3471…3472…3473  
**3967** …3968…3969  
**4463** …4464…4465  
4959…4960…4961

Not quite as many.

8127…8128…8129  
16255…16256…46257  
24383…24384…24385  
32511…32512…32513  
**40639** …40640…40641  
**48767** …48768…48769  
56895…56896… **56897**  
65023…65024…65025  
73151…73152…73153  
81279…81280… **81281**

only a few.

Aside from the tried and true 6x+/-1, do Perfect Numbers +/-1 have a significant advantage over some random even number +/-1?

---

<div class="post-metadata">

**Author:** ![Andy\_L](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Andy\_L](https://boards.straightdope.com/u/Andy_L)\
**Post date:** [November 8, 2017, 3:10am UTC](https://boards.straightdope.com/t/perfect-numbers-and-primes/801016/2 "2017-11-08T03:10:14Z")

</div>

I think you need to compare the number of Kx+/-1 primes to the average number of primes expected in a particular range of numbers. Primes are very common in numbers smaller than 28 (a third of the numbers from 1 to 27 are prime), so maybe it’s not that surprising that if you pick 8 numbers less than 25, all of a form that ensures that they are not divisible by 2 or 3, that 7 of them are prime. Since 28 and 496 are bigger than 6, you’re naturally going to find fewer primes of the form 28x+/-1 or 496+/-1 (since prime frequently drops off with the size of the number). Looking at numbers of the form 30x+/-1 we have  
\*\*  
29\*\* 30 \*\* 31\*\*  
\*\*59 \*\* 60 **61**  
**89** 90 91

which is almost as good as six - but that’s because 30=2_3_5, so I’ve eliminate a lot of possible composites, while still looking at numbers in ranges where primes are pretty common.

---

<div class="post-metadata">

**Author:** ![Andy\_L](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Andy\_L](https://boards.straightdope.com/u/Andy_L)\
**Post date:** [November 8, 2017, 3:40am UTC](https://boards.straightdope.com/t/perfect-numbers-and-primes/801016/3 "2017-11-08T03:40:47Z")

</div>

> [@Andy\_L](#):
>
> I think you need to compare the number of Kx+/-1 primes to the average number of primes expected in a particular range of numbers. Primes are very common in numbers smaller than 28 (a third of the numbers from 1 to 27 are prime), so maybe it’s not that surprising that if you pick 8 numbers less than 25, all of a form that ensures that they are not divisible by 2 or 3, that 7 of them are prime. Since 28 and 496 are bigger than 6, you’re naturally going to find fewer primes of the form 28x+/-1 or 496+/-1 (since prime frequently drops off with the size of the number). Looking at numbers of the form 30x+/-1 we have  
> \*\*  
> 29\*\* 30 \*\* 31\*\*  
> \*\*59 \*\* 60 **61**  
> **89** 90 91
> 
> which is almost as good as six - but that’s because 30=2_3_5, so I’ve eliminate a lot of possible composites, while still looking at numbers in ranges where primes are pretty common.

Actually, 30 does a lot better than 28

**29** 30 \*\* 31\*\*  
\*\*59 \*\* 60 **61**  
**89** 90 91  
119 120 121  
\*\*149 \*\* 150 **151**  
\*\*179 \*\* 180 **181**  
209 210 **211**

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [November 8, 2017, 4:02am UTC](https://boards.straightdope.com/t/perfect-numbers-and-primes/801016/4 "2017-11-08T04:02:59Z")

</div>

Reference: [prime number theorem](https://en.wikipedia.org/wiki/Prime_number_theorem#Prime_number_theorem_for_arithmetic_progressions)

The primes are evenly distributed among the possible congruence classes; this is not “obvious,” though, and requires an analytic proof.

---

<div class="post-metadata">

**Author:** ![markn\_1](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@markn\_1](https://boards.straightdope.com/u/markn_1)\
**Post date:** [November 8, 2017, 4:29am UTC](https://boards.straightdope.com/t/perfect-numbers-and-primes/801016/5 "2017-11-08T04:29:57Z")

</div>

It’s fairly obvious that primes must be of the form 6x+1 or 6x-1. The only other possibilities are 6x, 6x+2, 6x+3, and 6x+4. But the first, second and fourth are divisible by 2, and the third is divisible by 3, so none of these cases can be prime. This doesn’t have anything to do with the fact that 6 is perfect, but rather that it is divisible by 2 and 3.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [November 8, 2017, 4:49am UTC](https://boards.straightdope.com/t/perfect-numbers-and-primes/801016/6 "2017-11-08T04:49:37Z")

</div>

Yes. To elaborate, I meant that the number of primes of the form 6x+1, say enumerated up to some large number, is about the same as the number of primes of the form 6x-1. Same for 4x+1 and 4x-1, etc. I daresay that is not completely obvious.

---

<div class="post-metadata">

**Author:** ![Thudlow\_Boink](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/thudlow_boink/32/320_2.png) [@Thudlow\_Boink](https://boards.straightdope.com/u/Thudlow_Boink)\
**Post date:** [November 8, 2017, 5:02am UTC](https://boards.straightdope.com/t/perfect-numbers-and-primes/801016/7 "2017-11-08T05:02:34Z")

</div>

> [@Andy\_L](#):
>
> but that’s because 30=2_3_5, so I’ve eliminate a lot of possible composites, while still looking at numbers in ranges where primes are pretty common.

> [@Andy\_L](#):
>
> Actually, 30 does a lot better than 28

Off the top of my head, I suspected that abundant numbers might be even better than perfect numbers at having primes within ±1 of them, since they have lots of divisors themselves but are relatively prime to the numbers that are adjacent to them.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [November 8, 2017, 6:37am UTC](https://boards.straightdope.com/t/perfect-numbers-and-primes/801016/8 "2017-11-08T06:37:23Z")

</div>

So you just want numbers n such that φ(n) is small relative to n? Perfect numbers are ok, but much better to take numbers which are the product of many distinct primes: 2, 6, 30, 210, etc.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [November 8, 2017, 6:45am UTC](https://boards.straightdope.com/t/perfect-numbers-and-primes/801016/9 "2017-11-08T06:45:15Z")

</div>

ETA as n grows, so inevitably will φ(n), so what is the criterion for success? E.g., _all_ primes are of the form 2n+1, except 2, but φ(30) is 8 already.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [November 8, 2017, 2:08pm UTC](https://boards.straightdope.com/t/perfect-numbers-and-primes/801016/10 "2017-11-08T14:08:36Z")

</div>

There is a rather famous relationship between perfect numbers and prime numbers: There’s a one-to-one correspondence between the even perfect numbers and the Merseinne primes (it’s unknown if there are any odd perfect numbers, but if there are, this doesn’t work for them). If 2^n - 1 is a prime (a Merseinne prime), then 2^(n-1) \* (2^n - 1) is a perfect number, and all even perfect numbers are of this form.

For example, 3 is the first Merseinne prime (2^2 - 1). 3_2^1 = 6, the first perfect number. 7 (which is 2^3 - 1) is the second Merseinne prime, and 28 (which is 7_2^2) is the second perfect number. 31 is 2^5 - 1, and the third perfect number is 496, which is 31\*2^4.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [November 8, 2017, 2:19pm UTC](https://boards.straightdope.com/t/perfect-numbers-and-primes/801016/11 "2017-11-08T14:19:22Z")

</div>

Right; sorry about the abbreviated replies. If n is a perfect number of the form 2[sup]k-1/sup, then φ(n) = 2[sup]k-2/sup, about half of n, so even perfect numbers do no better than powers of 2 if you want φ(n) to be relatively small.
