# Twin primes

**URL:** <https://boards.straightdope.com/t/twin-primes/742774>\
**Category:** Factual Questions\
**Created:** [January 11, 2016, 3:32am UTC](https://boards.straightdope.com/t/twin-primes/742774 "2016-01-11T03:32:04Z")\
**Posts on this page:** 15\
**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:** [January 11, 2016, 3:32am UTC](https://boards.straightdope.com/t/twin-primes/742774/1 "2016-01-11T03:32:04Z")

</div>

> **[Twin prime](https://en.wikipedia.org/wiki/Twin_prime)**
>
> A twin prime is a prime number that is either 2 less or 2 more than another prime number—for example, either member of the twin prime pair (17, 19) or (41, 43). In other words, a twin prime is a prime that has a prime gap of two. Sometimes the term twin prime is used for a pair of twin primes; an alternative name for this is prime twin or prime pair.
> Twin primes become increasingly rare as one examines larger ranges, in keeping with the general tendency of gaps between adjacent primes to becom...

3,5…5,7…11,13…17,19…29,31…41,43…59,61…101,103…107,109…137,139…

Since all primes larger than 2 and 3 are of the form 6x-1 and 6x+1, what is significant about the 6x values between the twins?

2/3…1…2…3…5…7…10…17…18…23…

😕

---

<div class="post-metadata">

**Author:** ![Little\_Nemo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/little_nemo/32/3120_2.png) [@Little\_Nemo](https://boards.straightdope.com/u/Little_Nemo)\
**Post date:** [January 11, 2016, 3:53am UTC](https://boards.straightdope.com/t/twin-primes/742774/2 "2016-01-11T03:53:18Z")

</div>

Any positive integer has to be expressible as one of the following:

6n  
6n+1  
6n+2  
6n+3  
6n+4  
6n+5

Any number expressible as 6n+2 or 6n+4 is divisible by 2 and can’t be a prime. Any number expressible as 6n+3 is divisible by 3 and can’t be a prime. Any number expressible by 6n is divisible by both 2 and 3 and can’t be a prime.

So all primes must be expressible as either 6n+1 or 6n+5 (and 6n+5 is the same as 6n-1).

---

<div class="post-metadata">

**Author:** ![Little\_Nemo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/little_nemo/32/3120_2.png) [@Little\_Nemo](https://boards.straightdope.com/u/Little_Nemo)\
**Post date:** [January 11, 2016, 4:04am UTC](https://boards.straightdope.com/t/twin-primes/742774/3 "2016-01-11T04:04:19Z")

</div>

To take it a little further, you’ll see that any number that is expressible as 6n+5 will be divisible by 5 if n is divisible by 5. So you can use this to find larger primes which are not part of a pair.

For example, 6n+5 where n=100 is 605. 605 is divisible by 5 so it isn’t a prime. But 607 is a prime.

This won’t work if you choose a value for n that is divisible by both 5 and 7.

---

<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:** [January 11, 2016, 2:48pm UTC](https://boards.straightdope.com/t/twin-primes/742774/4 "2016-01-11T14:48:00Z")

</div>

It sounds like you’re asking whether there’s something special about those multiples of 6 that occur between the members of a pair of twin primes, as opposed to multiples of 6 that don’t. _As far as I know_, the answer is no.

---

<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:** [January 11, 2016, 3:14pm UTC](https://boards.straightdope.com/t/twin-primes/742774/5 "2016-01-11T15:14:19Z")

</div>

> [@Thudlow\_Boink](#):
>
> It sounds like you’re asking whether there’s something special about those multiples of 6 that occur between the members of a pair of twin primes, as opposed to multiples of 6 that don’t.

Yes, exactly.

---

<div class="post-metadata">

**Author:** ![chrisk](https://avatars.discourse-cdn.com/v4/letter/c/6de8d8/32.png) [@chrisk](https://boards.straightdope.com/u/chrisk)\
**Post date:** [January 11, 2016, 3:54pm UTC](https://boards.straightdope.com/t/twin-primes/742774/6 "2016-01-11T15:54:18Z")

</div>

To expand on what **Little Nemo** said, the special thing about 6 is that there are only two “spots” in that breakdown which allow primes. But for any composite number x, (especially ones which have more than one prime divisor,) there will be some values of y\<x for which no nx+y is prime, and some y where nx+y primes are possible.

for x=10, the y values which allow primes are 1, 3, 7, and 9. Thus, all primes greater than 10 will end with one of those four digits in decimal notation.

for x=14, the y values which allow primes are 1, 3, 5, 9, 11, and 13. For x=12, the y values which allow primes are 1, 5, 7, and 11, (which is really repeating the twin prime cycle twice.)

---

<div class="post-metadata">

**Author:** ![md2000](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@md2000](https://boards.straightdope.com/u/md2000)\
**Post date:** [January 12, 2016, 5:14am UTC](https://boards.straightdope.com/t/twin-primes/742774/7 "2016-01-12T05:14:09Z")

</div>

> [@chrisk](#):
>
> To expand on what **Little Nemo** said, the special thing about 6 is that there are only two “spots” in that breakdown which allow primes. But for any composite number x, (especially ones which have more than one prime divisor,) there will be some values of y\<x for which no nx+y is prime, and some y where nx+y primes are possible.
> 
> for x=10, the y values which allow primes are 1, 3, 7, and 9. Thus, all primes greater than 10 will end with one of those four digits in decimal notation.
> 
> for x=14, the y values which allow primes are 1, 3, 5, 9, 11, and 13. For x=12, the y values which allow primes are 1, 5, 7, and 11, (which is really repeating the twin prime cycle twice.)

And note the symmetry -  
For x=10, y=+1, +3, -1, -3  
For x=14, y=+1,+3, +5. -1, -3, -5  
Which brings us to the story about how the various students prove all odd numbers are prime…

Math major - “3 is print, 3+2=5 is prime, 5+2=7 is prime, therefore by induction, all odd numbers are prime.”  
Physics Major - “3 is prime, 5 is prime, 7 is prime, 9 - experimental error, 11 is prime, therefore all odd numbers are prime.”  
Engineering student - “3 is prime, 5 is prime, 7 is prime, 9 is prime, 11 is prime, therefore all odd numbers are prime.”  
Arts Major - “what’s a prime?”

Told this joke to my brother the engineer, he said, “ha ha - hey, wait a minute…”

---

<div class="post-metadata">

**Author:** ![Little\_Nemo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/little_nemo/32/3120_2.png) [@Little\_Nemo](https://boards.straightdope.com/u/Little_Nemo)\
**Post date:** [January 12, 2016, 6:21am UTC](https://boards.straightdope.com/t/twin-primes/742774/8 "2016-01-12T06:21:36Z")

</div>

There’s nothing inherently special about the 6n+1 and 6n-1 primes. They just happen to form an obvious pattern. Suppose instead of the product of 2 and 3, we started with the product of 2 and 5.

Then we could note that all integers are expressible as one of the following:  
10n  
10n+1  
10n+2  
10n+3  
10n+4  
10n+5  
10n+6  
10n+7 (10n-3)  
10n+8  
10n+9 (10n-1)

Now we eliminate the numbers that are products of 2 or 5 (just as we eliminated the numbers that are products of 2 or 3 previously): 10n, 10n+2, 10n+4, 10n+5, 10n+6, and 10n+8.

The possibilities we are left with are 10n+1, 10n+3, 10n+7, and 10n+9. In other words all primes larger than 2 and 5 are of the form 10n-1 or 3 and 10n+1 or 3.

You could do the same with any set of multiples and find equivalent patterns.

---

<div class="post-metadata">

**Author:** ![Hari\_Seldon](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/hari_seldon/32/5173_2.png) [@Hari\_Seldon](https://boards.straightdope.com/u/Hari_Seldon)\
**Post date:** [January 12, 2016, 11:37am UTC](https://boards.straightdope.com/t/twin-primes/742774/9 "2016-01-12T11:37:10Z")

</div>

There are “prime decades” when all four numbers 10n+1, 10n+3, 10n+7, 10n+9 are prime. The first such is 11, 13, 17, 19 and the second is 101, 103, 107, 109. A little thought shows that this is the only way you can have twin primes separated by 4.

---

<div class="post-metadata">

**Author:** ![septimus](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/septimus/32/410_2.png) [@septimus](https://boards.straightdope.com/u/septimus)\
**Post date:** [January 12, 2016, 12:14pm UTC](https://boards.straightdope.com/t/twin-primes/742774/10 "2016-01-12T12:14:18Z")

</div>

The decimal numbers 11 and 101 are prime. What is the next prime number, if any, which is one more than a power of ten (i.e. written in decimal as 1000…0001)?

---

<div class="post-metadata">

**Author:** ![LSLGuy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lslguy/32/5813_2.png) [@LSLGuy](https://boards.straightdope.com/u/LSLGuy)\
**Post date:** [January 12, 2016, 3:29pm UTC](https://boards.straightdope.com/t/twin-primes/742774/11 "2016-01-12T15:29:34Z")

</div>

Here’s a sorta-related thread from a couple months ago: [Prime number generator - Factual Questions - Straight Dope Message Board](http://boards.straightdope.com/sdmb/showthread.php?t=774140)

There are plenty more in the archives.

---

<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:** [January 12, 2016, 3:30pm UTC](https://boards.straightdope.com/t/twin-primes/742774/12 "2016-01-12T15:30:16Z")

</div>

You mean one more than a power of two. And that would be 10001, or 17 in decimal notation.

---

<div class="post-metadata">

**Author:** ![chrisk](https://avatars.discourse-cdn.com/v4/letter/c/6de8d8/32.png) [@chrisk](https://boards.straightdope.com/u/chrisk)\
**Post date:** [January 12, 2016, 4:13pm UTC](https://boards.straightdope.com/t/twin-primes/742774/13 "2016-01-12T16:13:34Z")

</div>

> [@Chronos](#):
>
> You mean one more than a power of two. And that would be 10001, or 17 in decimal notation.

No, I’m pretty sure **septimus** meant powers of ten–he never referred to binary notation. And it seems to be an interesting question. I’ve found [a discussion](https://www.physicsforums.com/threads/primes-of-form-10-k-1.392807/) where somebody claims to have checked 16 million numbers of this form (that is, up to 1 with sixteen million zeroes and a 1 at the end,) and not found a prime. On the other hand, nobody seems to have a generalized proof that no number of this sort would be prime.

---

<div class="post-metadata">

**Author:** ![Buck\_Godot](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/buck_godot/32/6573_2.png) [@Buck\_Godot](https://boards.straightdope.com/u/Buck_Godot)\
**Post date:** [January 12, 2016, 6:12pm UTC](https://boards.straightdope.com/t/twin-primes/742774/14 "2016-01-12T18:12:30Z")

</div>

from [wikipedia](https://en.wikipedia.org/wiki/Twin_prime#Other_theorems_weaker_than_the_twin-prime_conjecture),

for a value n to be between two twin primes it is necessary and sufficient that

```
   4((n-2)!+n+3 is divisible of (n-1)*(n+1)

```

I’m not sure that this is particularly useful, but there you are.

---

<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:** [January 12, 2016, 6:48pm UTC](https://boards.straightdope.com/t/twin-primes/742774/15 "2016-01-12T18:48:53Z")

</div>

> [@](#):
>
> No, I’m pretty sure septimus meant powers of ten–he never referred to binary notation.

…Oh. So he didn’t. My apologies, **septimus**. I guess I just saw all those zeroes and ones and my brain jumped straight to binary.
