3

Consulting https://oeis.org/A032592 shows that there are $35$ quartets of consecutive primes ending in $1,3,7,9$, yet the probability of this is only $1$ in $256$ up to $23869$ which is prime number $2654$.

There should be just ten of them from $\frac{2654}{256}$, yet there are $3.5$ more than probability.

Will this anomaly continue for increasing primes?

One could also ask if the frequency of quartets containing in ANY order the last digits $1,3,7,9$ accords with the probability of $\frac{3}{32}$.

  • 5
    How are you calculating the probability of this event? – lulu Jan 01 '21 at 23:41
  • 1
    There are 4^4 possible ways of filling four places each with four possible digits, and 1,3,7,9 in order is just one of 256. – J. M. Bergot Jan 02 '21 at 00:07
  • 2
    But why should we assume that these events are independent? – lulu Jan 02 '21 at 00:07
  • 1
    OK, if they are not independent, explain the improbable from the nature of the last digits of four consecutive primes. What is there inherent in the primes that causes this? – J. M. Bergot Jan 02 '21 at 00:19
  • If the answer given is true, then it can be verified by extending the search into larger primes. Will it approach 1 in 256 for the frequency of last digits 1,3,7,9 in order? – J. M. Bergot Jan 02 '21 at 00:27
  • 2
    I wouldn't use such small numbers as a predictor of any pattern. – lulu Jan 02 '21 at 00:30
  • @lulu I made a comment that disappeared about recommending that the sequence could be extended to get into higher realms to see if the frequency changes. Why is there no discussion allowed? – J. M. Bergot Jan 02 '21 at 03:57
  • I just remembered this one: https://youtu.be/YVvfY_lFUZ8 – Arthur Jan 02 '21 at 09:23
  • I never saw that comment, and have no idea why it was removed. As to extending the sequence, of course anyone is free to do that. If you do, you might want to keep the Chebysev Bias in mind...That is, for "small" numbers, there tend to be more primes of the form $4k+3$ then of the form $4k+1$. Or the variant, looking at remainders $\pmod 3$. The first time the latter is biased toward $1$ occurs at $p_n$, for $n=23338590792$. – lulu Jan 02 '21 at 12:41
  • This is an argument as an explanation of what MAY be true, that eventually the quartets 1,3,7,9 will return to a frequency closer to 1 in 256. Again, there is yet no evidence presented that this will be true. – J. M. Bergot Jan 02 '21 at 23:34

2 Answers2

2

You seem to be assuming that the last digit of two consecutive (but "randomly chosen") primes are independent. I see no reason to assume this, especially for as low primes as yours, where effects like twin primes (especially nice are the examples 11, 13 and 17, 19, and 101, 103 and 107, 109) are still relatively common, skewing the distribution toward even rather than uniformly random.

Another, or perhaps more general, effect is that as you reach 20 000, the average prime gap gets close to 10. Before that, having two consecutive primes with the same last digit is a bit rarer than pure random simply because the primes are too dense.

Arthur
  • 199,419
  • If the answer is correct, then it can be verified by simply extending the sequence. An argument is one thing, but facts are an other. You can find out more about last digits following one another form the table on page 2 of this short paper: https://arxiv.org/pdf/1603.03720.pdf to read that difference of 10 are certainly much less common. – J. M. Bergot Jan 02 '21 at 01:54
  • 3
    @J.M.Bergot I am not claiming to know anything about what the pattern is, neither for small nor large primes. My answer says "you have not searched far enough to be able to conclude anything substantial just from collecting simple statistics". Nothing more, nothing less. There may be a deeper pattern somewhere, but your search does not uncover it. – Arthur Jan 02 '21 at 09:10
  • One can always say to try more numbers, and if that doesn't work, then try even more of them. This can continue indefinitely and NO progress will be made. – J. M. Bergot Jan 03 '21 at 00:52
  • Why not just look at the primes to count the number of cases for four consecutive primes when last digits are 1,3,7,9 in any order? Take the first 1000 primes, the first 10000 primes, the first 100000 primes and so on to see if the frequency starts to drop as one continues. I just received your note on Sept. 21, 2022. – J. M. Bergot Sep 22 '22 at 05:25
  • 1
    It doesn't matter how far out you go; even if you don't see a drop-off, it could always happen later. Hasn't happened yet at a billion? Well, it might happen at a gogool. Hasn't happened at a gogool? Well, it might happen at around Graham's number. Hasn't happened there either? Still we have checked only a vanishingly small minority of the primes, it could always happen later. "Just checking" is never enough to prove a pattern, and that goes just as much, if not moreso, for the primes in particular. – Arthur Sep 22 '22 at 06:45
  • Say it doesn't happen at six googols, then it could still happen just a few greater than that. One thinks of the race between primes of the form 4n+1 and 4n+3. I guess we'll both have to wait for the final result only when the Chinese perfect their quantum computer. – J. M. Bergot Sep 23 '22 at 22:09
1

This question is similar to yours, but concerns only sequences of two successive primes, rather than four.

The same arguments that apply to that question apply to this one:

  • considering residues modulo 30 offers some further explanation
  • a sequence of residues which entails admissible numbers in between the smaller and larger primes having to be composite is less likely to occur than a sequence which doesn't; the more in-betweens that have to be composite, the less likely the sequence will occur that way

By "admissible number", in this context, I mean a number coprime to 30. The admissible residues modulo 30 are: 1, 7, 11, 13, 17, 19, 23, and 29. Seeing as there are 8, classifying four primes by their respective residues modulo 30 entails 4096 categories, which is rather a lot, so I won't do that.

Denote the four successive primes by $p_1, p_2, p_3, p_4$.

Among the most frequent ways $(1, 3, 7, 9)$ can arise are:

  • $30k+\{11,13,17,19\}$;
  • $30k+\{1,13,17,19\}$ provided $30k+\{7,11\}$ are composite
  • $30k+\{11,13,17,29\}$ provided $30k+\{19,23\}$ are composite

You could argue that $30k+11$ being composite is not a precondition for the $30k+\{1,13,17,19\}$ way; if prime, it does indeed produce an instance of $(1, 3, 7, 9)$, but it is counted as an instance of the first way, and therefore should not be counted again as an instance of the second way.

$(1, 3, 7, 9)$ is frequent, but the most frequent sequence of four residues modulo 10 turns out to be $(3, 9, 1, 7)$. Among the most frequent ways it can arise are:

  • $30k+\{23,29,31,37\}$
  • $30k+\{13,19,31,37\}$ provided $30k+\{17,23,29\}$ are composite
  • $30k+\{13,29,31,37\}$ provided $30k+\{17,19\}$ are composite
  • $30k+\{23,29,31,47\}$ provided $30k+\{41,43\}$ are composite
  • $30k+\{23,29,41,47\}$ provided $30k+\{31,37,43\}$ are composite

Again we have a way which doesn't entail any admissible numbers in between having to be composite, but in addition we have four further ways with only light restrictions on composites in between.

As an example of how a sequence of residues modulo 10 can arise from a sequence of admissible numbers modulo 30 and yet not be among the most frequent of sequences, consider $(7, 1, 3, 7)$. It occurs $<60000$ times among the first $10^7$ primes $p>5$. Cf 81324 occurrences of $(3,9,1,7)$ and 69289 of $(1,3,7,9)$. So how come $(7, 1, 3, 7)$ is not all that common? It can come from $30k+\{7,11,13,17\}$. But that's the only really common way. It can't arise when $p_1=30k+17$ and $p_4=30k+37=p_1+20$, so alternative ways entail at best $p_4=p_1+30$ and 5 of the 7 admissible numbers between $p_1$ and $p_4$ being composite.

Profiles for the most frequent sequences of residues modulo 10 among the first $10^7$ prime-quartets (up to 179424779):

$\begin{array}{cr} [ 3, 9, 1, 7 ] & 81324\\ [ 1, 3, 9, 1 ] & 75561\\ [ 9, 1, 7, 9 ] & 75289\\ [ 7, 9, 1, 7 ] & 75030\\ [ 3, 9, 1, 3 ] & 75006\\ [ 7, 9, 1, 3 ] & 74566\\ [ 1, 7, 9, 1 ] & 74412\\ [ 9, 1, 3, 9 ] & 74072\\ [ 9, 1, 3, 7 ] & 73699\\ [ 9, 1, 7, 3 ] & 73492\\ [ 3, 7, 9, 1 ] & 73488\\ [ 7, 3, 9, 1 ] & 73402\\ [ 1, 3, 7, 9 ] & 69289\\ [ 1, 7, 3, 9 ] & 69186\\ [ 9, 1, 7, 1 ] & 64857\\ [ 9, 3, 9, 1 ] & 64804\\ [ 1, 7, 9, 3 ] & 64784\\ [ 7, 1, 3, 9 ] & 64512\\ [ 1, 3, 9, 7 ] & 61397\\ [ 3, 1, 7, 9 ] & 61059\\ [ 7, 9, 3, 9 ] & 60590\\ [ 1, 7, 1, 3 ] & 60266 \end{array}$

Complementary sequences $[r_1, r_2, r_3, r_4]$ and $[10-r_4, 10-r_3, 10-r_2, 10-r_1]$ are likely to have similar counts and be close to each other in the ranking.

Some statistics to address the question implied by comments to the original question: do the proportions approach $1/256$ as more and more primes are taken? I list below tables of the number of occurrences of each of the most frequent sequences of residues modulo 10 of 4 successive primes, coming from runs over the first $N$ primes, for different values of $N$.

1000 primes up to 7963.

$\begin{array}{cr} [ 3, 9, 1, 7 ] & 26\\ [ 7, 3, 9, 1 ] & 18\\ [ 7, 9, 3, 9 ] & 17\\ [ 9, 1, 1, 3 ] & 17\\ [ 9, 3, 9, 1 ] & 17\\ [ 1, 3, 7, 9 ] & 16\\ [ 3, 9, 1, 3 ] & 16\\ [ 3, 7, 9, 3 ] & 15\\ [ 3, 7, 9, 3 ] & 15\\ [ 7, 1, 3, 7 ] & 14\\ [ 9, 1, 7, 3 ] & 14 \end{array}$

10000 primes up to 104789.

$\begin{array}{cr} [ 3, 9, 1, 7 ] & 139\\ [ 3, 9, 1, 3 ] & 124\\ [ 9, 1, 3, 7 ] & 117\\ [ 7, 3, 9, 1 ] & 114\\ [ 1, 3, 9, 1 ] & 108\\ [ 9, 1, 7, 9 ] & 106\\ [ 1, 7, 3, 9 ] & 105\\ [ 7, 1, 3, 9 ] & 105\\ [ 1, 3, 7, 9 ] & 104\\ [ 9, 1, 3, 9 ] & 102\\ [ 9, 1, 7, 3 ] & 102 \end{array}$

100000 primes up to 1299817.

$\begin{array}{cr} [ 3, 9, 1, 7 ] & 1061\\ [ 3, 9, 1, 3 ] & 970\\ [ 1, 3, 9, 1 ] & 939\\ [ 9, 1, 3, 7 ] & 904\\ [ 9, 1, 3, 9 ] & 903\\ [ 7, 9, 1, 7 ] & 901 \end{array}$

1000000 primes up to 15485959.

$\begin{array}{cr} [ 3, 9, 1, 7 ] & 9063\\ [ 3, 9, 1, 3 ] & 8214\\ [ 9, 1, 7, 9 ] & 8192\\ [ 1, 3, 9, 1 ] & 8189\\ [ 7, 9, 1, 7 ] & 8158\\ [ 1, 7, 9, 1 ] & 8053\\ [ 3, 7, 9, 1 ] & 8053\\ [ 7, 3, 9, 1 ] & 8080 \end{array}$

$N$ goes up by a factor of 10 each time, but the counts of these the most frequently-occurring sequences go up by a slightly lower factor. This shows that as $N$ goes up, the most frequently-occurring sequences get less frequent; the proportions are starting to level.

Rosie F
  • 2,913