simple proof to explain the "shocking" news about primes last digits not being random

Mar 16, 2016 39 Replies

Ok another new idea that still has to be verified:

For primes ending in 7 within a primorial30 block the chance of two primes ending in 7 should be 19.6% I am pretty sure.. the discrepancy with the 17.757% comes from consecutive primes that cross from one primorial block into another, and/or in a higher primorial ie primorial

210 block.

Most consecutive primes that end in 7 will be *within* a specific primorial block of numbers, but some will cross from one primorial block into the next, and if they do this, then they have to graduate up to the next primorial ie if consecutive primes ending in 7 cross from one primorial30 block to the next, then they go in the primorial210 block, and IF they crossed the fifth primorial30 block, they also will go in the primorial 30030 block! These primes that cross primorial blocks are what changes the 19.6% value down to 17.757% I think.

Here is an example of primorial blocks and how they can be crossed by consecutive primes.

(primorial6)(primorial6)(primorial6)(primorial6)(primorial6) = (primorial30 block)

(primorial30) has 5 primorial6 blocks within it

(primorial210) primorial210 block has 7 primorial 30 blocks within it.

So if there are a pair of consecutive primes, they could be within a single primorial30 block, or across two consecutive primorial30 blocks, or in a single primorial210 block, or across two primorial210 blocks, or in a single primorial30030 block, or across two primorial30030 blocks etc.. and each time the block size increases, the probability of the two consecutive primes ending in digit 7 gets closer to 25%.

But to get the overall likelihood of everything all the primorial block sizes should be taken into account, as well as the frequency that primes cross from one block to another etc..

Just more speculating anyway still gotta verify all this.

cheers, Jamie

I can reproduce the 17.757% for "7 7" (mod 10) like this, using PARI/gp:

? c77 = 0; c7 = 0; lastp=7; forprime(q = 8, 2038074750, rc=q%10; rl=lastp%10; if(abs(rl-7)

Hi,

I just wrote this, maybe it can be used to get the 17.757% if it is correct?

The probability of two consecutive primes that end in 7 occurring should depend on which primorial grouping the two primes occur in counted from one. If the two primes cross 30 number spacing then they will be in a larger primorial ie 210. Any time one of the spacing is crossed to a larger primorial, the likelihood of the consecutive primes occuring with the same last digit gets closer to 25% since eulerphi(primorial), which is the number of equations that can produce prime numbers within the primorial grouping increases. The primorial groupings all start at one and go up: ((6)(6)(6)(6)(6))=(30) (30)(30)(30)(30)(30)(30)(30)=(210) (210) * 11 times = (2310)

If consecutive primes ending with digit 7 cross one of those groupings then it is in a higher/larger grouping with more equations, and thus closer to 25% equal distribution of consecutive 1,3,7,9 digits.

cheers, Jamie

I found 10^20 a bit big. For pairs of consecutive primes p_k , p_{k+1} in the range 10^18, 10^18 + 10^9, I find

6030113 cases of (7, x) (mod 10), where x is one of 1, 3, 7, 9 and 1269493 cases of (7, 7) (mod 10), for a conditional probability of 21.06 % chance of (7, 7) given a (7, x) pair, modulo 10:

? c77 = 0; c7 = 0; lastp= 1000000000000000003 ; forprime(q =

1000000000000000004, 1000000001000000000, rc=q%10; rl=lastp%10; if(abs(rl-7)

Hi,

I guess it would be good to try a range that your computer can handle, do you get other results different from 17.757% ie for up to 1billion or up to 4billion?

cheers, Jamie

But you haven't proved it. Your proof is fundamentally flawed.

Sylvia.

Hi,

This makes sense from what I was saying, since as the number gets bigger, the primes are spaced further apart, and thus it is more likely that the two consecutive primes occupy a higher primorial block with more equations that produce all the primes given by eulerphi(primorial). So the distribution approaches 25% as the primes spread out and occupy bigger primorial blocks.

cheers, Jamie

Repost >> If we look instead at the block of primes from 10^20 to 10^20 + 10^9, >> the probability of "7 7" (mod 10) given a "7" (mod 10) should >> be closer to 25% . But by how much? > > I found 10^20 a bit big. For pairs of consecutive primes > p_k , p_{k+1} in the range 10^18, 10^18 + 10^9, I find > > 6030113 cases of (7, x) (mod 10), where x is one of > 1, 3, 7, 9 and 1269493 cases of (7, 7) (mod 10), > for a conditional probability of > 21.06 % chance of (7, 7) given a (7, x) pair, modulo 10: > > ? c77 = 0; c7 = 0; lastp= 1000000000000000003 ; forprime(q = > 1000000000000000004, 1000000001000000000, rc=q%10; rl=lastp%10; > if(abs(rl-7) > > 6030113 1269493 > 21.052557389886391847051622415699341 > > dave >

Hi,

This makes sense from what I was saying, since as the number gets bigger, the primes are spaced further apart, and thus it is more likely that the two consecutive primes occupy a higher primorial block with more equations that produce all the primes given by eulerphi(primorial). So the distribution approaches 25% as the primes spread out and occupy bigger primorial blocks.

cheers, Jamie

Hi,

If you can do this I think you might find a surprising result:

If you segment the large number into groups of 30 numbers starting at 1, then the probability of "7 7" repeating last digit primes within those

30 numbers should remain constant (2/8 + 1/7)/2= 0.196 19.6% I think no matter what large number you test at, as long as it is done within the segmented 30 number primorial blocks.

cheers, Jamie

The authors of the arxiv preprint, Lemke Oliver and Soundararajan, say their heuristic argument is based on the Hardy-Littlewood prime k-tuples conjecture :

<
formatting link
> .

dave

pub 4096R/41C769D6 2014-11-04 uid David Bernier (doubledeckerpot5)

Hi,

I think the whole statistics of the prime distribution should be explainable by assuming the primes are totally randomly filled into deterministic locations given by primorial formulas.

ie.

y = 30x + 1 y = 30x + 7 y = 30x + 11 y = 30x + 13 y = 30x + 17 y = 30x + 19 y = 30x + 23 y = 30x + 29

Out of every consecutive 30 numbers there are 8 repeating locations that primes can occur, all 22 other locations never have primes up to infinity for each 30 number group.

Filling these 8 locations with primes randomly, using the prime counting function for the probability of how many locations are filled for a given x, probably can explain all prime distribution statistics and if not then there is some non-random pattern to the prime distribution I think.

There seems to be lots of opportunity to waste time thinking about all this stuff anyway its still a mystery :D

cheers, Jamie

Hi,

For these eight equations:

y = 30x + 1 y = 30x + 7 y = 30x + 11 y = 30x + 13 y = 30x + 17 y = 30x + 19 y = 30x + 23 y = 30x + 29

that produce all primes, here is the statistical distribution for how often the 8*8=64 permutations of the equations occur consecutively when producing primes:

primeA, primeA+1, count

7 11 2945 11 13 2916 17 19 2914 29 1 2904 23 29 2893 13 17 2892 19 23 2887 1 7 2849 23 1 2209 11 17 2193 17 23 2181 13 19 2163 1 11 2159 19 29 2154 29 7 2153 7 13 2087 23 7 1824 7 17 1624 13 23 1590 1 13 1585 19 1 1561 11 19 1551 17 29 1551 29 11 1526 29 13 1345 17 1 1278 13 29 1160 7 19 1138 11 23 1133 1 17 1087 19 7 1020 23 11 993 19 11 957 1 19 811 7 23 795 11 29 783 29 17 774 13 1 737 17 7 724 23 13 720 1 23 665 7 29 633 13 7 560 11 1 547 23 17 543 29 19 519 19 13 517 17 11 516 13 11 448 19 17 431 23 19 431 11 7 421 1 29 410 17 13 380 29 23 363 7 1 330 13 13 274 11 11 266 17 17 265 19 19 261 7 7 260 1 1 241 23 23 226 29 29 221

7 to 11 transition is most common with 2945 occurrences, and the 29 29 consecutive primes are least common with 221 occurrences.

This makes sense since the primes that are spaced closer together occur more frequently, but maybe there are additional patterns in this distribution too.

cheers, Jamie

Carrying on from the last post:

7 17 1624 17 7 724 17 17 265 7 7 260

Those are the 4 possible consecutive primes with digits ending in 7 and how often they occur. The sum of all the above counts is 78494, and the end digit 7?s have 2873 as their combined count, which is 3.6% of the overall count.

This closely matches the formula for probability of what would be expected, generated by this python code that gives the probability of having K consecutive samles in a population of N in M draws (python code by Ludvig Ericson)

%matplotlib inline from functools import reduce import operator prod = lambda L: reduce(operator.mul, L, 1.0) def p(N, K, M): return sum(K/prod(N ? k ? i for k in range(K))*prod((N-K-j)/(N-j) for j in range(i)) for i in range(M-K+1)) p(8,2,2) #two consecutive out of 8, with first 2 picked

output: 0.03571428571428571 (close to 3.6%)

For the example of primes ending in 3?s:

13 23 1590 23 13 720 13 13 274 23 23 226

The sum of counts is 2810, and 2810/78494 = 3.579%

For primes ending in 9?s:

19 29 2154 29 19 519 19 19 261 29 29 221

The sum of counts is 3155, and 3155/78494 = 4.019%

For primes ending in 1?s:

1 11 2159 11 1 547 11 11 266 1 1 241

The sum of counts is 3213, and 3213/78494 = 4.09%

These 16 combined:

1 11 2159 11 1 547 11 11 266 1 1 241 7 17 1624 17 7 724 17 17 265 7 7 260 13 23 1590 23 13 720 13 13 274 23 23 226 19 29 2154 29 19 519 19 19 261 29 29 221

Have a total of 12051 counts and 12051/78494=15.35%

So one quarter of the possible groups of consecutive primes (16 of the

64) occur only about 15.35% of the time, (as opposed to the expected 25%) whereas the other 48 consecutive primes with non-matching least digits occur more often that would be expected.

So can probability and/or combinatorics explain this?

cheers, Jamie

It seems to be the most simple formula to determine the number of equations, and I'd understood that such a simple formula was part of your question.

Gottfried

Am 16.03.2016 um 17:51 schrieb Jamie M:

No, it is simply part of the output of Pari/GP (the implicite numbering of the output of the formulae)

Gottfried

Thanks for that. One of the most striking things about it is that p(a=1,b=9) and p(a=9,b=1) are radically different. Numbers taken from the paper and put into Excel for a quick look see.

b\a 1 3 7 9

1 4,623,042 6,010,982 6,373,981 7,991,431 24,999,436 3 7,429,438 4,442,562 6,755,195 6,372,941 25,000,136 7 7,504,612 7,043,695 4,439,355 6,012,739 25,000,401 9 5,442,345 7,502,896 7,431,870 4,622,916 25,000,027 24,999,437 25,000,135 25,000,401 25,000,027

Jamie is for once right at least in the sense that p(x,x) is substantially lower than all the other combinations.

Though p(1,9) is also a low outlier.

The conditional probabilities rounded look something like:

b\a 1 3 7 9

1 0.185 0.240 0.255 0.320 3 0.297 0.178 0.270 0.255 7 0.300 0.282 0.178 0.241 9 0.218 0.300 0.297 0.185
Regards, Martin Brown

[snip code]

It probably would take pari/gp close to the same time to compute all last-digit-to-last-digit transition counts, as for one or two particular pairs. Below are some transition counts based on the 40 million primes following 10^15. (Note, the rightmost column is a row total, but the first row is one short, there being one less transition than the total number of primes considered).

: 1 3 7 9 1: 2063808 2802379 2786971 2348004 10001163 3: 2474340 2038677 2698526 2787378 9998921 7: 2530456 2626431 2042241 2801603 10000731 9: 2932559 2531434 2472992 2062202 9999187

The number of 1-1, 3-3, 7-7, and 9-9 transitions were about

20.6%, 20.4%, 20.4%, and 20.6%, respectively, of the transitions from 1, 3, 7, and 9.

The number of 1-3, 3-7, 7-9, and 9-1 transitions were about

28%, 27%, 28%, and 29%, respectively, of the transitions from 1, 3, 7, and 9.

Both of those results are in line with the idea that the last digit of a prime's successor prime are more likely to be a nearby value, instead of a more-distant value. For a prime p with last digit p%10,

3 of every 4 {1,3,7,9}-spots are closer to p than are {p%10}-spots.

Here's a table of percentages of transitions (from units digit as shown in left column, to units digit as in the heading line) for numbers from n# to 2*(n#) with n=29 (so nLo=6469693230, nHi=12939386460). : 1 3 7 9 1: 19.04 29.25 29.39 22.32 70397392 3: 24.27 18.50 27.85 29.38 70399939 7: 25.43 26.82 18.49 29.26 70401458 9: 31.25 25.43 24.28 19.04 70398938

jiw

P(a=1,b=9) are primegaps of length 8 + k*10 P(9=1,b=1) are primegaps of length 2 + j*10

Primegaps of length 2 are more frequent than that of length 8 Primegaps of length 12 are more frequent than that of length 18 ... summary: 2,12,22,32,... more frequent than 8,18,28,38,...

( see a graph of that at:

formatting link
)

That's my intuitive explanation.

Gottfried

Lol I guess thats a compliment? Anyway I found a new pattern once I made the primes encoded binary sequence, the pattern became clearly visible:

formatting link

Thats all zeros and ones, depending on if a prime is at the positions given by the formulas:

y = 30x + 1 y = 30x + 7 y = 30x + 11 y = 30x + 13 y = 30x + 17 y = 30x + 19 y = 30x + 23 y = 30x + 29

The pattern can be seen if the zeros and ones are displayed as a bitmap, but only if there is the correct number of columns in the bitmap, and that is the pattern I found, the column count to show the pattern seems to be this for primorial30:

8*prime (where 8 is how many coprimes 30 has)

I tested prime 7 so far, but I think the pattern seen might hold for larger primes too.

When 8*7=56 columns are used ie here are the first 20 rows, all having columns of zeros:

0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,1,0,0, 1,0,0,1,1,1,1,1,1,0,1,0,1,0,1,1,1,1,1,1,0,0,1,0,0,1,1,1,1,0,0,0,1,1,0,0,1,1,1,1,0,1,0,1,0,1,1,1,0,1,1,0,0,1,0,1, 1,0,1,1,0,1,1,1,0,1,1,1,1,0,0,1,0,1,1,0,0,1,1,1,0,0,1,1,0,0,0,0,1,1,0,0,1,0,1,1,1,1,0,0,1,0,1,1,1,1,0,1,1,1,0,0, 1,0,1,1,1,0,1,1,1,0,0,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,0,1,1,0,0,1,0,0,1,0,0,1,1,0,1,1,1,1,0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,1,0,0,1,1,0,0,1,0,0,1,0,0,1,1,1,1,1,0,0,0,1,0,0,0,1,1,0,1,0,1,1,1,0,0,0,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,0,1, 0,0,0,1,1,0,1,1,1,0,0,0,0,0,0,1,1,0,1,0,0,1,1,0,0,1,1,0,0,1,0,0,1,1,0,0,0,1,1,1,0,0,0,0,0,1,0,1,1,0,0,0,1,0,0,0, 0,0,0,1,1,1,0,0,1,1,1,0,0,0,1,1,0,1,1,0,0,1,0,0,0,0,1,1,1,1,0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,1,1,1,0,0,1,1,0,0,1, 1,0,1,1,0,0,0,1,1,0,0,0,1,0,1,0,0,0,0,1,0,0,0,1,0,1,1,1,1,1,0,0,0,0,1,0,0,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,1,1,0,0, 1,0,1,1,0,0,1,0,0,1,0,1,1,0,1,0,1,1,0,1,0,0,0,1,0,0,1,1,1,0,0,0,1,1,1,0,0,1,0,1,0,1,0,1,0,1,0,0,0,0,1,0,1,1,0,1, 0,0,0,1,1,0,1,0,0,0,1,1,0,0,1,0,0,1,1,1,0,0,1,0,0,1,1,0,0,1,0,0,0,1,1,0,1,1,1,1,1,0,0,1,1,0,0,0,0,1,0,0,0,0,0,1, 0,0,1,1,1,0,1,1,1,1,0,0,0,0,0,1,1,1,0,0,0,0,1,1,0,0,1,1,0,1,0,0,1,0,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,1,0,0,0,0,0,0,

The columns of zeros match up to give these patterns that can be verified:

30x+7 is always NOT prime every seventh x 30x+19 is always NOT prime every seventh x (offset one from x for 30x+7) 30x+17 is always NOT prime every seventh x (offset two from x for 30x+7) and continuing for other zero columns.

So I can increase the compression of this prime binary sequence further.

Here is a picture showing the pattern of zero columns that occur for

8*7 columns

formatting link

Here is a picture showing there are also zero columns (narrow white vertical lines) for 8*83, so it is probable that for any 8*prime, there are zero columns that show a further pattern of spacings that are not primes.

formatting link

I guess if you add up all these not prime rules you can get a formula for prime numbers :D

cheers, Jamie

Hi,

Here's some more data using primorial 210 instead of primorial 30 equations showing distribution of prime last digits:

There are too many permutations to show for all 210 equations that show the last digits of consecutive primes, but here are some highlight results of a subset of the 48 primorial210 equations:

y=210x+b where b = {1 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67

71 73 79 83 89 97 101 103 107 109 113 121 127 131 137 139 143 149 151 157 163 167 169 173 179 181 187 191 193 197 199 209}

Here are some of the overall set of procurance permutations for the above equations:

primeA, primeA+1, count

97 101 581 37 41 578 17 19 572 113 121 571 73 79 568 29 31 566 31 37 562 193 197 560 ... 151 173 131 19 41 131 187 209 130 127 149 130 113 139 128 169 191 127 121 143 127 67 89 125 31 53 124 101 121 124 ... 59 103 31 149 181 31 101 137 30 61 101 30 53 89 30 97 131 30 167 197 29 181 13 29 131 167 29 ... 53 103 6 197 43 6 97 139 6 97 143 6 19 67 6 143 191 6 23 67 6 89 139 6 19 61 6 31 83 6 ... 83 157 1 11 73 1 23 107 1 173 43 1 169 47 1 131 191 1 23 83 1 83 151 1 103 179 1 67 121 1 181 31 1

That is a huge discrepancy of consecutive last digits occurrences that can be explained with simple statistics, based on how far ahead in number gap the next prime is, ie the top occurring last digit grouping "97 to 101" occurred 581 times, and this is a 4 digit spacing, while the lower occurring last digit groupings, ie "181 to 31" at the bottom, only occurred 1 time. This is a (209-181)+31=59 number gap in the primes, so it makes sense that it occurred less often than the closer spaced primes.

The pairs like "17 to 17" didn't even show up once in the test I did since that is 210 digits apart for consecutive primes within a primorial210 block.

The same thing can be done for larger primorial equation sets, ie primorial 2310 with 480 equations and 480^2 permutation of the consecutive last digit pairings will show a huge discrepancy in the last digits (up to last 4 digits) of consecutive prime numbers.

Here is the C# code excerpt used to do this test:

foreach (int prime in Primes) { foreach (int i in new[] { 1, 11, 13, 17, 19, 23,

29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 121, 127, 131, 137, 139, 143, 149, 151, 157, 163, 167, 169, 173, 179, 181, 187, 191, 193, 197, 199, 209 }) { if (((prime - i) % 210) == 0) {

x210plusSORTED.Add(i); } } }

Dictionary pairCounts = new Dictionary(); ChirpletPairCounts chirpletPairCounts = new ChirpletPairCounts();

pairCounts = chirpletPairCounts.GetPairCounts(x210plusSORTED);

var pairCountsSorted = pairCounts.Values.OrderByDescending(x => x);

class ChirpletPairCounts {

public ChirpletPairCounts() {

}

public Dictionary GetPairCounts(IList sequence) { Dictionary pairCounts = new Dictionary(); for (int i = 0; i < sequence.Count - 1; i++) { var Key = Tuple.Create(sequence[i], sequence[i + 1]); if (pairCounts.ContainsKey(Key)) { pairCounts[Key]++; } else { pairCounts.Add(Key, 1); } } return pairCounts; }

}

cheers, Jamie

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required