The Last Digit of Prime Numbers - Numberphile

Numberphile · 806K views · 2016 · 9:44

Open on YouTube

Pure mathematicsRecreational & visual mathexplainer

Why Mathematics Stack Exchange recommends it

Mathematics Stack Exchange users link it as the source of the claim that a prime's last digit makes the next prime less likely to share it, and ask follow-up questions about the numbers.

Recommended by 0 people across 0 different months, 2016 to 2025.

What it is

A Numberphile video in which Dr James Grime explains a 2016 paper showing that consecutive primes are less likely than chance to share the same last digit. He walks through the data and the surprising bias in how last digits follow one another, with a link to the arXiv paper.

What people said

Cites psmith · 2016-05 · Mathematics Stack Exchange · on “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. Edit1: Link to the numberphile video [this video] 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 65265

Cites Mr Pie · 2018-06 · Mathematics Stack Exchange · on “Does there exist a formula to calculate $2.357137939171\ldots$?”

@GerryMyerson there is a youtube video. I will find it and show you. Hold on a second...... ok **here** [this video] it is.

Cites oloid · 2025-07 · Mathematics Stack Exchange · on “strange digit preference for fully reptend primes built from only two digits”

I noticed a strange numerical imbalance for those full reptend primes p (i.e. 10 is a primitive root modulo p; see [LINK] ) that have all except one digit in their decimal expansion the same: For many digit counts, the repeated digit must be 7. (Example: the list of all cases for 17 digits is [77777777776777777, 77777777977777777, 77797777777777777].) There seem to always exist such full reptend primes, even if we restrict to the repeat digit being 7 — I verified that observation for digit counts 3 to 102 (which amounts to 100 cases of digit counts, of which 46 — just like the digit count 17 seen above — only feature 7 as the repeat digit). It appears to be a strange imbalance similar to tha