John Carlos Baez on Nostr: How many primes are there below x? This is called π(x), and it's a most fascinating ...
How many primes are there below x? This is called π(x), and it's a most fascinating function. How can we approximate it?
Gauss noticed that the probability that a number n is prime looks close to 1/ln(n). If so, π(x) should be close to the integral of 1/ln(n) from 0 to x. This integral is called li(x).
If you compare li(x) to π(x) you'll see it starts out bigger. Indeed it's known to be bigger for all x up to 10¹⁹. But in 2000, two mathematicians named Bays and Hudson showed that π(x) catches up with li(x) and gets bigger for x close to 1.39 ×10³¹⁶.
That's a huge number! We can't precisely count all the primes up to 1.39 ×10³¹⁶ - listing them would overfill the observable universe. So I became interested in how we actually show π(x) gets bigger than li(x) at this point. Bays and Hudson made
some graphs of
(π(x) - li(x)) ⋅ ln(x)/√x
but they look very ugly, so I decided to see if I could make better ones. Here's one!
The blue curve is the best estimate we can get using a table of the first 2,001,052 nontrivial zeros of the Riemann zeta function - it turns out they're important here. The red curve is basically a smoothed version of the blue curve. The blue curve is not completely trustworthy, but if the red curve goes above zero for long enough, we can be sure that π(x) exceeds li(x) somewhere in that region. Using this, Bays and Hudson showed there are at least 10¹⁵³ integers n with π(n) > li(n) near 1.39822 × 10³¹⁶ .
It's so cool to be able to probe what's going on for such large numbers!
(1/2)
Published at
2026-10-28 10:03:40 UTCEvent JSON
{
"id": "52f9af994f710fb92949c04bc1faa6d483e22d61dbbbed2952ff061d627d2c3b",
"pubkey": "9a6a1a8eefd0b53d7e0c966ab35bd904151246f03b1be98fa0d2d0eeb4940320",
"created_at": 1793181820,
"kind": 1,
"tags": [
[
"imeta",
"url https://media.mathstodon.xyz/media_attachments/files/117/517/896/402/716/953/original/2079dc420a4fb13a.png",
"m image/png"
],
[
"proxy",
"https://mathstodon.xyz/@johncarlosbaez/117517963795571858",
"web"
],
[
"proxy",
"https://mathstodon.xyz/users/johncarlosbaez/statuses/117517963795571858",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://mathstodon.xyz/users/johncarlosbaez/statuses/117517963795571858",
"pink.momostr"
],
[
"-"
]
],
"content": "How many primes are there below x? This is called π(x), and it's a most fascinating function. How can we approximate it?\n\nGauss noticed that the probability that a number n is prime looks close to 1/ln(n). If so, π(x) should be close to the integral of 1/ln(n) from 0 to x. This integral is called li(x). \n\nIf you compare li(x) to π(x) you'll see it starts out bigger. Indeed it's known to be bigger for all x up to 10¹⁹. But in 2000, two mathematicians named Bays and Hudson showed that π(x) catches up with li(x) and gets bigger for x close to 1.39 ×10³¹⁶. \n\nThat's a huge number! We can't precisely count all the primes up to 1.39 ×10³¹⁶ - listing them would overfill the observable universe. So I became interested in how we actually show π(x) gets bigger than li(x) at this point. Bays and Hudson made\nsome graphs of \n\n (π(x) - li(x)) ⋅ ln(x)/√x \n\nbut they look very ugly, so I decided to see if I could make better ones. Here's one! \n\nThe blue curve is the best estimate we can get using a table of the first 2,001,052 nontrivial zeros of the Riemann zeta function - it turns out they're important here. The red curve is basically a smoothed version of the blue curve. The blue curve is not completely trustworthy, but if the red curve goes above zero for long enough, we can be sure that π(x) exceeds li(x) somewhere in that region. Using this, Bays and Hudson showed there are at least 10¹⁵³ integers n with π(n) \u003e li(n) near 1.39822 × 10³¹⁶ .\n\nIt's so cool to be able to probe what's going on for such large numbers!\n\n(1/2)\nhttps://media.mathstodon.xyz/media_attachments/files/117/517/896/402/716/953/original/2079dc420a4fb13a.png\n",
"sig": "739ec2dca10bb8a7c1ca05e1a90ae9a845db2760fecabaa3be993f6832176e0573c6d05ece6fc5ff4e9119957107375ef5fdf448bd8c8aead18b795abd120a26"
}