Decimal digit frequency in steady primes

Mike Olson
2 min readDec 20, 2023

Update: There are two other posts on this topic. The predecessor to this post is my introduction to right-truncatable primes, and the successor to this post is on right-truncatable primes in other number bases.

Yesterday, I wrote about a number theory project I’ve been playing with — steady primes. I was excited about having found all of the terminal steady primes in base 10, so banged out that entry in a hurry.

This morning, I did a little more analysis. I was surprised by the number of 3 and 9 digits in the terminal steady primes, and wanted to look into that a little more deeply. I calculated the frequency of every digit, 0 through 9, in my list of terminal steady primes. I did the same for my list of the first 100,000,000 prime numbers.

Here’s a bar chart comparing those frequencies:

Just to help you read that chart, on the X axis, the first entry is for digit 0. The chart shows that zero never appears in a steady prime, but that it makes up 8.09% of all the digits in the first 100 million prime numbers.

Threes and nines are nearly three-quarters of all the digits in the terminal steady primes!

It’s interesting to look at the digit frequencies in the first 100 million, as well. Digits 4, 5, 6, and 8 are all about equally probable. Zeroes are a bit less likely to show up, and 2s are a bit more likely. Threes, 7s and 9s are all more likely, and pretty much tied with one another. Then there’s the digit 1 — shows up almost twice as often as the group including 4s!

This chart will be fun to think about in my spare time over the holidays.

--

--

Mike Olson

Berkeley-based techie with an interest in business. Worried about the world.