mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Prime Gap Searches (https://www.mersenneforum.org/forumdisplay.php?f=131)
-   -   Prime gap following a twin pair (https://www.mersenneforum.org/showthread.php?t=24497)

 robert44444uk 2019-06-07 16:24

Prime gap following a twin pair

I'm a bit surprised to see that Sloane does not have the sequence 2,4,4,4,6,4,6,6,4,4..

These are the gaps between the larger of a pair of twins and the next prime. Results for all twins up to 10000 are shown below:

Col A & B = twin pair
Col C = the next prime
Col D - the gap to the next prime

There are no gaps 2mod6 other than the first !! All twins with primes >3 are 5mod6 and 1 mod6, where 1mod6 is the larger. Hence a gap of 2mod6 would provide the next prime as 3mod6, which is divisible by 3. Contradiction.

My hunch is that these gaps are larger than regular prime gaps...I wonder if they are?
[CODE]
3 5 7 2
5 7 11 4
11 13 17 4
17 19 23 4
29 31 37 6
41 43 47 4
59 61 67 6
71 73 79 6
101 103 107 4
107 109 113 4
137 139 149 10
149 151 157 6
179 181 191 10
191 193 197 4
197 199 211 12
227 229 233 4
239 241 251 10
269 271 277 6
281 283 293 10
311 313 317 4
347 349 353 4
419 421 431 10
431 433 439 6
461 463 467 4
521 523 541 18
569 571 577 6
599 601 607 6
617 619 631 12
641 643 647 4
659 661 673 12
809 811 821 10
821 823 827 4
827 829 839 10
857 859 863 4
881 883 887 4
1019 1021 1031 10
1031 1033 1039 6
1049 1051 1061 10
1061 1063 1069 6
1091 1093 1097 4
1151 1153 1163 10
1229 1231 1237 6
1277 1279 1283 4
1289 1291 1297 6
1301 1303 1307 4
1319 1321 1327 6
1427 1429 1433 4
1451 1453 1459 6
1481 1483 1487 4
1487 1489 1493 4
1607 1609 1613 4
1619 1621 1627 6
1667 1669 1693 24
1697 1699 1709 10
1721 1723 1733 10
1787 1789 1801 12
1871 1873 1877 4
1877 1879 1889 10
1931 1933 1949 16
1949 1951 1973 22
1997 1999 2003 4
2027 2029 2039 10
2081 2083 2087 4
2087 2089 2099 10
2111 2113 2129 16
2129 2131 2137 6
2141 2143 2153 10
2237 2239 2243 4
2267 2269 2273 4
2309 2311 2333 22
2339 2341 2347 6
2381 2383 2389 6
2549 2551 2557 6
2591 2593 2609 16
2657 2659 2663 4
2687 2689 2693 4
2711 2713 2719 6
2729 2731 2741 10
2789 2791 2797 6
2801 2803 2819 16
2969 2971 2999 28
2999 3001 3011 10
3119 3121 3137 16
3167 3169 3181 12
3251 3253 3257 4
3257 3259 3271 12
3299 3301 3307 6
3329 3331 3343 12
3359 3361 3371 10
3371 3373 3389 16
3389 3391 3407 16
3461 3463 3467 4
3467 3469 3491 22
3527 3529 3533 4
3539 3541 3547 6
3557 3559 3571 12
3581 3583 3593 10
3671 3673 3677 4
3767 3769 3779 10
3821 3823 3833 10
3851 3853 3863 10
3917 3919 3923 4
3929 3931 3943 12
4001 4003 4007 4
4019 4021 4027 6
4049 4051 4057 6
4091 4093 4099 6
4127 4129 4133 4
4157 4159 4177 18
4217 4219 4229 10
4229 4231 4241 10
4241 4243 4253 10
4259 4261 4271 10
4271 4273 4283 10
4337 4339 4349 10
4421 4423 4441 18
4481 4483 4493 10
4517 4519 4523 4
4547 4549 4561 12
4637 4639 4643 4
4649 4651 4657 6
4721 4723 4729 6
4787 4789 4793 4
4799 4801 4813 12
4931 4933 4937 4
4967 4969 4973 4
5009 5011 5021 10
5021 5023 5039 16
5099 5101 5107 6
5231 5233 5237 4
5279 5281 5297 16
5417 5419 5431 12
5441 5443 5449 6
5477 5479 5483 4
5501 5503 5507 4
5519 5521 5527 6
5639 5641 5647 6
5651 5653 5657 4
5657 5659 5669 10
5741 5743 5749 6
5849 5851 5857 6
5867 5869 5879 10
5879 5881 5897 16
6089 6091 6101 10
6131 6133 6143 10
6197 6199 6203 4
6269 6271 6277 6
6299 6301 6311 10
6359 6361 6367 6
6449 6451 6469 18
6551 6553 6563 10
6569 6571 6577 6
6659 6661 6673 12
6689 6691 6701 10
6701 6703 6709 6
6761 6763 6779 16
6779 6781 6791 10
6791 6793 6803 10
6827 6829 6833 4
6869 6871 6883 12
6947 6949 6959 10
6959 6961 6967 6
7127 7129 7151 22
7211 7213 7219 6
7307 7309 7321 12
7331 7333 7349 16
7349 7351 7369 18
7457 7459 7477 18
7487 7489 7499 10
7547 7549 7559 10
7559 7561 7573 12
7589 7591 7603 12
7757 7759 7789 30
7877 7879 7883 4
7949 7951 7963 12
8009 8011 8017 6
8087 8089 8093 4
8219 8221 8231 10
8231 8233 8237 4
8291 8293 8297 4
8387 8389 8419 30
8429 8431 8443 12
8537 8539 8543 4
8597 8599 8609 10
8627 8629 8641 12
8819 8821 8831 10
8837 8839 8849 10
8861 8863 8867 4
8969 8971 8999 28
8999 9001 9007 6
9011 9013 9029 16
9041 9043 9049 6
9239 9241 9257 16
9281 9283 9293 10
9341 9343 9349 6
9419 9421 9431 10
9431 9433 9437 4
9437 9439 9461 22
9461 9463 9467 4
9629 9631 9643 12
9677 9679 9689 10
9719 9721 9733 12
9767 9769 9781 12
9857 9859 9871 12
9929 9931 9941 10
[/CODE]

 LaurV 2019-06-08 02:36

[QUOTE=robert44444uk;518808]My hunch is that these gaps are larger than regular prime gaps...I wonder if they are?[/QUOTE]
You mean correspondent terms (terms with the same index) in the two sequences, "prime gaps" and "gaps after twin primes"? At a first sight I see no reason why the two sequences wouldn't cross infinitely often.

 robert44444uk 2019-06-08 06:59

I'm thinking that given an average prime gap following a prime p is given by ln(p) that the average gap following the larger of a twin pair p' is > ln(p')

 CRGreathouse 2019-06-08 15:49

[QUOTE=robert44444uk;518843]I'm thinking that given an average prime gap following a prime p is given by ln(p) that the average gap following the larger of a twin pair p' is > ln(p')[/QUOTE]

How much bigger are you thinking? 1.1 log p', log p' log log p', log p' + log p'/log log p', log p' + sqrt(log p')?

 LaurV 2019-06-08 15:52

Oh, in that way...
That may be true, and not easy to prove.

First impression is that the average gap after p' is still log(p'), and the smaller of the two twins may have nothing to do with it. But on the other hand, strange things may happen after twins... (think primorials, by this logic, the average gap after a primorial +/-1 should still be log(x+/-1), but is not).

Edit: crossposted, my reply was for robert's post

 robert44444uk 2019-06-09 07:50

In response to both. I will investigate when I return from a short trip. My hunch is based on the prevalence of twins and 2 mod 6 gaps compared to the general population of gaps. I don't expect much of an uptick, perhaps 1.01*ln(p'). But let's see. As LaurV says, strange things might happen around twins.

Presumably if there is an effect on the next prime side of the twin, we might expect the same effect on the previous prime.

 CRGreathouse 2019-06-09 14:55

[QUOTE=robert44444uk;518925]Presumably if there is an effect on the next prime side of the twin, we might expect the same effect on the previous prime.[/QUOTE]

Agreed.

[QUOTE=robert44444uk;518925]In response to both. I will investigate when I return from a short trip. My hunch is based on the prevalence of twins and 2 mod 6 gaps compared to the general population of gaps. I don't expect much of an uptick, perhaps 1.01*ln(p'). But let's see. As LaurV says, strange things might happen around twins.[/QUOTE]

Asymptotically, that's what I'd consider a big increase, an increase in the leading term. I don't expect to see an effect that large.

 robert44444uk 2019-06-09 17:19

Here are some raw numbers for gaps following twin primes in the integer ranges from 5 to n, where n is the first column in the table. The merit of each gap, given by g(p')/ln(p') where p' is the larger member of a twin prime and g(p') is the gap that follows p' to the next prime is calculated for each gap.

The second column provides the merit of the median gap in an array of all twin primes in the 5 to n range, ordered by the merit of the gaps

the third column provides the sum of the merits for all gaps following all twin pairs in the 5 to n range divided by the number of gaps in the range 5 to n - i.e. the average merit

The median result looks odd to me, especially the median at 1e7 compared to 1e8. Maybe its my program!

[CODE]
n median average
1e4 1.130409 1.174763
1e5 0.960076 1.140654
1e6 0.879785 1.12384
1e7 0.800977 1.10489
1e8 0.875686 1.091765
1e9 0.861240 1.084227
[/CODE]

This is the same set of calculations for the primes up to 1e8:

[CODE]
n median average
1e4 0.790794 1.015308
1e5 0.778257 1.004082
1e6 0.780593 1.001669
1e7 0.765885 1.000514
1e8 0.744425 1.000131

[/CODE]

And the percentage uptick for each set:

[CODE]
n median average
1e4 42.95% 15.71%
1e5 23.36% 13.60%
1e6 12.71% 12.20%
1e7 4.58% 10.43%
1e8 17.63% 9.16%
[/CODE]

These are huge upticks! I was thinking 1%.

For the gaps preceding the twins, the results closely mirror the results for the gaps following the twins even down to the 1e7 median anomaly - this looks exceedingly odd

[CODE]
n median average
1e4 1.095597 1.16574
1e5 0.965776 1.161442
1e6 0.878152 1.113329
1e7 0.802137 1.10796
1e8 0.876182 1.092035
[/CODE]

 VBCurtis 2019-06-09 22:05

Would it be valuable to compare these upticks to the size of gap after a prime n given n+2 is known to be not-prime?
I wonder how much is a sort of 'magical' clearing out of primes around twins, versus the simple explanation that removing a possible gap of 2 from the distribution of next-prime-gap alters the averages/medians in this way.

 robert44444uk 2019-06-10 06:08

[QUOTE=VBCurtis;518974]Would it be valuable to compare these upticks to the size of gap after a prime n given n+2 is known to be not-prime?
I wonder how much is a sort of 'magical' clearing out of primes around twins, versus the simple explanation that removing a possible gap of 2 from the distribution of next-prime-gap alters the averages/medians in this way.[/QUOTE]

I'm not certain there is any "twin" effect at play here, but I am nervous about that statement. The reduction in the average percentage uptick for larger n suggests that this uptick is caused by a localised effect involving the count of small gaps and hence the n+2 prohibition is likely to be the main culprit.

As well as n+2 out, it possible to take out all 2mod6 - I'm sure we can explain away most (if not all) of the uptick. I'm not sure how to do this, other than by looking at the basic distribution of prime gaps and removing some of these from the distribution. gaps of length 0mod(x#) where # represents a primorial are greater in number. Removing the 2mod6 gaps is above my pay grade.

 robert44444uk 2019-06-10 10:33

[QUOTE=robert44444uk;518957]

The median result looks odd to me, especially the median at 1e7 compared to 1e8. Maybe its my program!

[/QUOTE]
I investigated this further, and there are very large swings in the median calculation depending on the absolute numbers of gaps by size in a given range. For example between 1.4e7 and 1.5e7 the median gap is 16, with merit 0.968 whereas for 1.5e7 to 1.6e7 the median gap is 12 with merit 0.726. If there had been just two more 12 gaps in the 1.4e7 to 1.5e7 range, then the median gap would have been 12 and not 16.

Hence median gaps are less helpful for analysis.

All times are UTC. The time now is 00:28.