<p align="center" width="100%">
<img width="100%" src="att/pi-day-2025-panel.png">
</p>
# The Basel Problem, π and the probability of coprimality
2025-03-14, Valencia
On Pi Day, many celebrate the beauty of π as it appears in circles, waves, and oscillations. However, π’s reach extends far beyond geometry. One of the most fascinating—yet less widely known—connections involves its role in number theory. In particular, π emerges from the solution of the Basel Problem and even appears in the probability that two random integers are coprime.
## The Basel Problem: historical background
The Basel Problem asks for the exact sum of the series
$
\sum_{n=1}^{\infty} \frac{1}{n^2} = 1 + \frac{1}{4} + \frac{1}{9} + \frac{1}{16} + \cdots
$
Initially posed by Pietro Mengoli in the 17th century, this problem remained unsolved for nearly a century. It was the Basel mathematicians—members of a vibrant mathematical community in Basel, Switzerland—who first studied it in earnest. However, it was Leonhard Euler who, in 1734, astonished the mathematical world by finding the exact sum of the series,
$
\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}
$
Euler’s result was revolutionary because it revealed a deep and unexpected connection between a seemingly simple infinite series and π, a constant originally associated only with the geometry of circles.
## Euler's approach
Euler’s method was both creative and daring for his time. He began by considering the function
$
\frac{\sin(x)}{x},
$
which has a well-known Taylor series expansion
$
\frac{\sin(x)}{x} = 1 - \frac{x^2}{3!} + \frac{x^4}{5!} - \cdots
$
On the other hand, Euler knew from the work on infinite products that sine could be expressed as
$
\frac{\sin(x)}{x} = \prod_{n=1}^{\infty} \left(1 - \frac{x^2}{\pi^2 n^2}\right)
$
By equating the Taylor series expansion with the infinite product and comparing coefficients of like powers of x, Euler extracted the sum of the reciprocals of the squares of the natural numbers, arriving at
$
\frac{\pi^2}{6} = \sum_{n=1}^{\infty} \frac{1}{n^2}
$
This connection was not only a triumph of mathematical creativity but also a profound demonstration of the unity between analysis and number theory.
## From infinite sums to infinite products: the Euler Product Formula
Euler’s insights did not stop with the Basel Problem. Building on the fundamental theorem of arithmetic—which states that every positive integer can be factored uniquely into primes—Euler expressed the Riemann zeta function, defined for $\Re(s) > 1$ by
$
\zeta(s) = \sum_{n=1}^{\infty} \frac{1}{n^s},
$
as an infinite product over all prime numbers, given by
$
\zeta(s) = \prod_{p \, \text{prime}} \frac{1}{1 - p^{-s}}
$
When we set $s = 2$, we obtain
$
\prod_{p \, \text{prime}} \frac{1}{1 - p^{-2}} = \zeta(2) = \frac{\pi^2}{6}
$
Taking the reciprocal yields an expression that will soon have a probabilistic interpretation
$
\prod_{p \, \text{prime}} \left(1 - \frac{1}{p^2}\right) = \frac{6}{\pi^2}
$
## π and the probability of coprimality
The infinite product
$
\prod_{p}\left(1 - \frac{1}{p^2}\right)
$
can be interpreted in a probabilistic context. Consider two random integers. For any given prime $p$, the probability that an integer is divisible by $p$ is $\frac{1}{p}$. Therefore, the probability that both integers are divisible by $p$ is $\frac{1}{p^2}$, and consequently, the probability that at least one is not divisible by $p$ is
$
1 - \frac{1}{p^2}
$
Assuming the divisibility by different primes behaves independently (a heuristic that can be rigorously justified in this context), the probability that no prime divides both integers is given by the product over all primes
$
\Pr(\gcd(a, b) = 1) = \prod_{p}\left(1 - \frac{1}{p^2}\right)
$
Substituting Euler’s product result yields
$
\Pr(\gcd(a, b) = 1) = \frac{6}{\pi^2} \approx 0.6079
$
Thus, there is about a 60.8% chance that two randomly selected integers are coprime. This elegant result—linking a geometric constant (π) to a probability in number theory—epitomizes the interconnected nature of mathematics.
## Mathematical implications
### Analytic continuation
Euler’s work on the Basel Problem paved the way for the development of analytic number theory. His techniques inspired later mathematicians, including Bernhard Riemann, to study the analytic properties of the zeta function. The extension of the zeta function to the entire complex plane (except for a simple pole at $s = 1$) via analytic continuation has profound implications, notably in the distribution of prime numbers as encapsulated in the famous Riemann Hypothesis.
### Serie-product interplay
Euler’s method of comparing a Taylor series expansion with an infinite product was groundbreaking. It revealed that infinite sums and products—although seemingly different in nature—can encode the same information. This duality is now a cornerstone in many areas of mathematics, including complex analysis and quantum physics.
### Probabilistic number theory
The interpretation of the Euler product as a probability illustrates the power of probabilistic methods in number theory. It provides insight into how “random” behaviour can emerge from the deterministic structure of the integers. This interplay has led to further developments, such as the study of the distribution of prime numbers and various probabilistic models that approximate number theoretic functions.
## Conclusion
The Basel Problem and Euler’s subsequent discoveries serve as a reminder of the unexpected unity within mathematics. The fact that π—an emblem of geometry—determines the probability that two random integers are coprime highlights the deep and surprising connections that lie at the heart of mathematical inquiry. Euler’s legacy continues to inspire mathematicians to explore these interwoven themes, bridging gaps between analysis, number theory, and probability.
Happy π day!