# Prime gaps and last digit of prime numbers

I recently saw a video about the last digit of prime numbers, that if a prime ends with a digit X then it is the least likely that the next prime also has X as the last digit.

But I counted the prime gaps (modulo 10) for primes between 200 million and 2 billion and the result is this:

• 0: 15885351
• 2: 19886835
• 4: 17246764
• 6: 18937346
• 8: 15265989

Why 0 is not the least common prime gap modulo 10? I expected it to be significantly less then any other gaps.

Edit2: below the counts how many times the digit on the left is followed by the digit on the top (for the last digit of primes between 200 million and 2 billion):

1       3       5       7       9
1 4047130 6467273       0 6526597 4763818
3 5250387 3896688       0 6133642 6525043
5       0       0       0       0       0
7 5557028 5885706       0 3893204 6469289
9 6950273 5556094       0 5251784 4048329

You see the counts in the main diagonal are much lower than any other.

• Um, why should it be? Could you link to the video and/or summarize it's argument about why 0 would be least? I can't think of any reason why 10 should be less then any other (for numbers large enough for gaps of multiples of 10 to be common). – fleablood May 13 '16 at 16:02
• I guess you are talking about this. nature.com/news/… which, I admit is odd. 0 is significantly lower than all except 8. Which seems to contradict that the same digit is least likely as it appears 2 less would be less likely. However that isn't a contradiction because... – fleablood May 13 '16 at 16:20
• ... i'm not sure the proper way to express this is statistic vocabulary but summing the likelihoods over the digits isn't the same as summing the likelihoods and distributing them over the digits. Let's say a 1 followed by a 1, 3 by 3, etc. are all the least likely but a 1 followed by a 1 is for less likely than a 3 followed by 3. In fact a 3 followed by a 3 is even more likely than a 1 followed by a 3 which in turn is less likely than a 1 followed by a one. This way each digits gap is least likely to be 0 but the least likely gap overall could by 8. – fleablood May 13 '16 at 16:27
There are only three last digits that can lead to a gap of $8$ while there are four that can lead to a gap of $10$. If the last digit of a prime is $7$, a gap of $8$ would lead to a number whose last digit is $5$, which cannot be prime. This suppresses gaps of $8$.
$0: 4047130+3896688+3893204+4048329=15885351\\ 2: 6467273+6469289+6950273=19886835\\ 4: 6133642+5557028+5556094=17246764\\ 6: 6526597+6525043+5885706=18937346\\ 8: 4763818+5250387+5251784=15265989\\$