Library · Geometric Probability · Chapter 56
Three coprime integers
Problem 56.1
Let be three integers chosen independently and uniformly from . As , what is the probability that ?
Solution. Repeat the Euler-product argument of Chapter 52. For each prime , let . Since each of is divisible by with probability , and the three divisibility events are independent, The triple has iff , and the events across distinct primes are essentially independent in the large- limit (joint divisibility factorises by the Chinese remainder theorem). Hence
To justify passing from finitely many primes to all primes, first retain only primes . Their joint divisibility probabilities converge as stated. Uniformly in , the probability that a prime divides all 3 sampled integers is at most , so the union bound makes the omitted probability at most , which tends to as .
By the Euler product for the Riemann zeta function, , so Therefore
The constant is called Apéry’s constant; Roger Apéry proved in 1978 that it is irrational, a result that surprised number theorists because the analogous is a transcendental number by Lindemann’s theorem, but has no known closed form in terms of or other classical constants. So unlike the two-variable case of Chapter 52 (where the answer is ), the three-variable coprime probability is a constant with no known simpler form.
The general formula, for integers uniformly distributed, is ; the limit as is (all large--tuples are asymptotically coprime, since the probability that some fixed prime divides all of them decays as ).
import numpy as np
Nmax, N = 10**4, 10**6
a, b, c = np.random.randint(1, Nmax+1, (3, N))
g = np.gcd(np.gcd(a, b), c)
p = (g == 1).mean()
zeta3 = 1.2020569031595942 # Apery's constant
print(f"sim: {p:.5f} exact: {1/zeta3:.5f}")
# sim: 0.83191 exact: 0.83191