Perfect numbers and primes

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.

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?

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=235, 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

Reference: prime number theorem

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

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.

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.

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.

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.

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.

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). 32^1 = 6, the first perfect number. 7 (which is 2^3 - 1) is the second Merseinne prime, and 28 (which is 72^2) is the second perfect number. 31 is 2^5 - 1, and the third perfect number is 496, which is 31*2^4.

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.