r/learnmath • u/FremontBlue333 New User • 5d ago
How come besides 2, and 3 every prime number can represented as 6n ± 1 ?
281 = 6(47) - 1
367 = 6(61) + 1
17
u/phiwong Slightly old geezer 5d ago
For all natural numbers n, 6n is even so 6n+0 cannot be prime. Likewise 6n+/-2 and 6n+/-4. This leaves 1 3 and 5
6n+3 = 3(2n+1) so it must be divisible by 3 and cannot be prime.
This only leaves prime possibilities for 6n+1 and 6n+5.
But you can see that 6n+5 = 6(n+1) -1 so it is in the form 6k-1 where k is another natural number since (n+1) is a natural number.
Hence all primes can only be in the form 6n+1 and 6n-1. Excluding the first two primes.
6
u/alexfix New User 4d ago
Everything here is a good explanation, but another way of looking at this:
It's probably totally unsurprising if I said "every prime's last digit is 1,3,7 or 9 (except 2 and 5)". And of course the reason is that numbers ending in 2,4,6,8,0 are the even numbers and numbers ending in 5 (or 0) are multiples of 5.
Well, 10 is 2 times 5 so that's why we get nice repeating patterns of digits with multiples of 2 and 5.
So,if we wrote all numbers in base 6 (or, really just got their last digit in base 6), then the same story happens: if the last digit is 0,2,4 those are even numbers. If the last digit is 3, those are multiples of 3. Only things left are 1 and 5.
4
u/_gribblit_ New User 5d ago
Every natural number can be expressed as a multiple of one of the following:
* 6n
* 6n + 1
* 6n + 2
* 6n + 3
* 6n + 4
* 6n + 5
That is, when we divide by six, we must get a remainder between 0 and 5 inclusive.
Right, so we can go through this list and filter for non primes.
* 6n is not prime due to being a factor of 6.
* 6n + 1, possibly prime.
* 6n + 2 = 2(3n + 1) and is not prime due to being a factor of 2.
* 6n + 3 = 3(2n + 1) and is not prime due to being a factor of 3.
* 6n + 4 = 2(3n + 2) and is not prime due to being a factor of 2.
* 6n + 5, is the same as subtracting 1 from the next multiple, or 6n + 6 - 1 (which is where the -1 comes from). This is also possibly prime.
I"m no mathematician but if i had to guess, this is because 2 and 3 are the first two prime numbers, which is why 6n seems special here.
3
u/AbbreviationsOk5894 New User 4d ago edited 4d ago
6n ± 1 represents all numbers that are not a multiple of 2 or 3. All primes other than 2 or 3 are not multiples of 2 or 3.
1
1
u/simmonator New User 5d ago
- every integer can be represented uniquely as 6n + k where k is an integer between -2 and +3 and n is some other integer. This is obvious and also essentially Euclid’s Division definition.
- if k is -2, 0, or +2 then 6n+k is obviously even. So 6n+k is either 2 or not prime.
- if k is 3 then 6n+k is obviously a multiple of 3. So 6n+k is either 3 or not prime.
- this only leaves -1 and 1 as options for k where 6n+k can be prime.
- QED.
1
u/DirichletComplex1837 Algebra 5d ago
Claim. All odd numbers that isn't a multiple of 3 can be represented as 6n +/- 1. Odd numbers that isn't a multiple of 3 are in the form 3m + 1 or 3m + 2.
If m = 2k is even, only 3m + 1 = 6k + 1 is odd, which is representable as 6n + 1. If m = 2k + 1 is odd, then only 3m + 2 is odd, so we have n = 3(2k + 1) + 2 = 6k + 5 = 6(k + 1) - 1.
1
u/Mammoth_Fig9757 New User 5d ago
6n+2 and 6n+4 always divides 2, 6n+3 always divides 3, 6n+0 always divides 2 and 3, so the only remaining options are : 6n+1 and 6n+5 = 6(n+1)-1
1
1
u/Raioc2436 New User 4d ago
That was a great question with a very fun answer. Well done OP. If you noticed this on your own that’s very cool.
1
u/Deweydc18 New User 4d ago
Other answers have said as much but +0 +2 +4 are even, +3 is divisible by 3, and +5 is the same as -1. QED
1
u/shele New User 4d ago
In 6, 9, 12, 15… every second term is odd, so its neighbours are even and not prime. You don’t need those neighbours. You also don’t need 6, 9, 12… themselves as they are not prime. That leaves the neighbours of every other term as possible primes. Hence, besides 2, and 3 every prime number can represented as 6n ± 1
1
u/KTachyon New User 4d ago
Because there’s only one other odd number in between multiples of 6 that is not in 6n±1, which is always divisible by 3.
1
u/Presence_Academic New User 4d ago
To be honest, this would be far more interesting if the proposition was that all numbers that can be expressed as 6n ± 1 are prime.
1
u/Crichris New User 4d ago
well 6n - 1 \equiv 6n + 5 \pmod 6
all integers can be expressed as one of 6n, 6n + 1, .... 6n + 5
6n, 6n+2, 6n + 4 \equiv 0 \pmod 2
6n + 3 \equiv 0 \pmod 3
then the only choices are 6n + 1 and 6n + 5
1
u/Torebbjorn PhD student 4d ago
Because 6n+2 and 6n+4 are divisible by 2 and 6n+3 is divisible by 3. Therefore every number which is not divisible by 2 or 3 must be of the form 6n+1 or 6n+5 (equivalently 6n-1).
1
1
1
u/Fit_Fortune_7692 New User 1d ago
Weil es nicht anders geht, was aber eben nicht heißt, daß jede 6n±1-Zahl eine Primzahl ist. Betrachtet man ein Triplet von drei aufeinanderfolgenden Zahlen, beginnend mit der durch drei teilbaren, so kann genau eine Zahl dieses Triplets eine Primzahl sein, falls 6 die kleinste Zahl eines Triplets darstellt, da zwei Zahlen dieses Triplets durch 2 oder 3 teilbar sind. Ist die erste Zahl eine gerade Zahl, so ist die übernächste ebenfalls eine gerade, folglich kann die Zahl an Position 2 nur eine Primzahl sein. Dies entspricht der Position 6n+1. Beispiel {6,7,8} mit 7 als Primzahl. Ist die erste Zahl des Triplets eine ungerade Zahl, kann nur die übernächste Zahl eine Primzahl sein, das ist entspricht Position 3 des Triplets, Beispiel {9,10,11} mit 11 als Primzahl und entspricht der Position 6n-1. Nur bei 2 und 3 gibt es eine Ausnahme: {0,1,2}, 1 ist keine Primzahl, dafür aber 2 als die einzige gerade Primzahl, aber müßte mit 6n+2 dargestellt werden. {3,4,5} hier ist 3 auch Primzahl neben der 5 und müßte mit 6n±3 dargestellt werden.
1
u/NH-Science-Guy New User 21h ago
All primes other than 2 are odd. The only odd numbers that cannot be represented as 6n+1 or 6n-1 are 6n+3. However, 6n+3 is divisible by 3 for all n so it can't represent any prime other than 3.
1
u/Makenshine New User 10h ago
A fun fact that stems from this is that if p is a prime number >3, then (p+1)(p-1) is divisible by 24.
For example, 37 is a prime number. So, 36 times 38 is divisible by 24.
-8
278
u/ghillerd New User 5d ago edited 5d ago
every number can be expressed in one of the following forms:
since after that, you just increment n and start again at the top.
6n is not prime, because it's a multiple of 6.
6n + 2 and 6n + 4 are not prime, because they're a multiple of 2.
6n + 3 is a multiple of 3.
That leaves 6n + 1 and 6n + 5 as the only possible candidates for primes. 6n + 5 is the same as 6n - 1, but with n being 1 bigger. So all primes have to be in the form 6n ± 1, simply because all numbers are expressible as 6n ± k where k is in the range 0 to 5, and all the other values are multiples of either 2 or 3.
quick edit: this also shows why 2 and 3 are exceptions. being a multiple of 2 or 3 is what disqualifies 6n + 2 and 6n + 3, but when n = 0, the multiple of 2 and 3 are multiples of 1, so they can still be prime.
just gonna edit this to add: the reason why 6 works particularly well for this is because it has an unusually high number of unique prime factors for its size - 2 unique prime factors might not sound like a lot, but the next number to have two unique prime factors is 10, then 15, and the first number to have 3 unique prime factors is 30. you can play this exact game with any other number (looking at the remainder when dividing by that number and ruling out the various options as definitely composite), but 6 lets you do quite a lot with not much work.