
Prime After Prime (2016) - ricardomcgowan
http://bit-player.org/2016/prime-after-prime
======
aardvarks
Actually, even the first two tables comparing the frequency of 1,2,3,4,5,6
when obtained using primes vs. a fair die suggest that consecutive primes do
not give a truly random (uncorrelated) way of choosing congruence classes mod
7.

If I throw a fair die 10^6 times, the probability of getting any given single
outcome should behave according to Poisson statistics. On average, if I repeat
a trial of 10^6 die-throwings many times, the number of outcomes of "4" (let's
say) should be on average 10^6/6 = 166,667 , as mentioned in the article.

However, the exact number of times "4" comes up in a given trial itself
follows a distribution around that average whose spread is about
sqrt(166,667), or about 400. So the typical "error" in the frequencies given
in the table should be ~few hundred.

By this reasoning, the deviations in the top table, the one given by the
primes, are surprisingly small -- of order tens rather than hundreds. In other
words, primes are _more_ equitably distributed among congruence classes than
we would _expect_ independent die roll outcomes to be.

~~~
caf
Yes, at the bottom of the article is an Addendum that covers this:

 _Addendum 2016-06-14. I noted above that the distribution of primes mod 7
seems flatter, or more nearly uniform, than the result of rolling a fair die.
John D. Cook has taken a chi-squared test to the data and shows that the fit
to uniform distribution is way too good to be the plausible outcome of a
random process. His first post deals with the specific case of primes modulo
7; his second post considers other moduli._

------
Zmetta
6x±1: 5,7,11,13,17,19,23, _25_ ,29,31, _35_ ,37,41,43,47, _49_ ,53, _55_
,59,61, _65_ ,67,71,73, _77_ ,79,83, _85_ ,89, _91_ , _95_ ,97,

101,103,107,109,113, _115_ , _119_ , _121_ , _125_ ,127,131, _133_ ,137,139,
_143_ , _145_ ,149,151, _155_ ,157, _161_ ,163,167, _169_ ,173, _175_
,179,181, _185_ , _187_ ,191,193,197,199, _203_ , _205_ , _209_ ,211

Is this just a poor sieve for odd-number pairs or is there something more
going on within the factors of 6x±1?

~~~
ladberg
I think it's just a sieve that removes multiples of 2 and 3, leaving false
positives that are multiples of 5, 7, 11, etc.

~~~
caf
Right, which is why as the numbers get larger and the primes get more sparse,
30 eventually takes over from 6 as the sieve (2x3x5).

------
mCOLlSVIxp6c
[https://web.archive.org/web/20191202152434/http://bit-
player...](https://web.archive.org/web/20191202152434/http://bit-
player.org/2016/prime-after-prime)

------
erickhill
Now I've got Cyndi Lauper in my head.

~~~
Tycho
Strange thing about that song - I can _never_ remember what the verse melody
goes like. I can remember the bridge and chorus always. Usually I would just
sort of play through the song in my head until I get back to the verse but
never seems to work. If I hear it I will have forgotten it again the next day.

------
simonhughes22
Interesting. It seems to me that the two consecutive primes, modulo 7, are
more likely to be an odd and even pair (i.e. the total of the 2 modulo is more
likely to be odd) than an odd odd or even even pair.

------
dang
Discussed at the time:
[https://news.ycombinator.com/item?id=11837511](https://news.ycombinator.com/item?id=11837511)

