Six stories in which a computer (or a patient human calculator) confirmed a rule many times — and the rule was false nonetheless.
A computer experiment is a powerful tool for discovery: it suggests conjectures and quickly refutes bad ideas.
But a finite number of checks — even $10^{50}$ — does not prove a theorem about infinitely many cases.
All computations on this page are performed by your browser, with integers of arbitrary length.
Euler, 1772
$n^2 + n + 41$ — nothing but primes?
Green: prime value, red: composite. Click a cell.
40 consecutive confirmations prove nothing — and here a proof is impossible, because for $n = 41$ we have $41^2+41+41 = 41\cdot 43$. No nonconstant polynomial with integer coefficients takes only prime values.
Fermat, 1640 · Euler, 1732
Fermat numbers $F_n = 2^{2^n} + 1$
n
Fn
status
Click to search the candidate divisors of the form k·2n+2 + 1 (Euler–Lucas theorem).
Fermat generalized from five cases ($F_0,\dots,F_4$ are prime). Euler found $641 \mid F_5$. To this day, no other Fermat prime is known.
Moser’s problem
Into how many regions do chords divide a disk?
1, 2, 4, 8, 16 — “obviously” powers of two. But for 6 points there are 31 regions. The true formula is $\binom{n}{4}+\binom{n}{2}+1$; it agrees with $2^{n-1}$ only for $n \le 5$.
number theory · resultant
$\gcd\bigl(n^{17}+9,\ (n+1)^{17}+9\bigr) = 1$?
The pattern holds for every $n < 8.4\cdot 10^{51}$ — no experiment will refute it. Mathematics settles it: the gcd divides the resultant of the two polynomials, which equals the prime $p\approx 8.9\cdot 10^{51}$, and gcd $> 1$ exactly when $n \equiv n_0 \pmod p$.
D. and J. Borwein, 2001
The Borwein integrals: $\int_0^\infty \prod_{k=0}^{m} \operatorname{sinc}\frac{x}{2k+1}\,dx$
m
$\sum_{k=1}^{m}\frac{1}{2k+1}$
value of the integral
Seven times the result is exactly $\pi/2$, and the eighth time — $\pi/2$ minus about $2.31\cdot 10^{-11}$. The cause is structural: the sum $\frac13+\frac15+\dots+\frac1{15}$ exceeds $1$ for the first time. Typical numerical integration would not notice this difference at all.
Pólya, 1919 · Haselgrove, 1958 · Tanaka, 1980
The Pólya conjecture: $L(n) = \sum_{k\le n}\lambda(k) \le 0$
$\lambda(k) = (-1)^{\Omega(k)}$, where $\Omega(k)$ is the number of prime factors of $k$ counted with multiplicity. The conjecture: for $n \ge 2$, at least half of the numbers $\le n$ have an odd number of factors.
A plot “glued” to zero from below looks like a proof. Haselgrove (1958) showed that the conjecture is false, and the smallest counterexample is $n = 906\,150\,257$ (Tanaka, 1980) — far beyond this plot.
What is going on here?
Each example is a different source of illusion: too few cases (Euler, Fermat, Moser), cases too small (gcd — the first counterexample has 52 digits),
too little precision (Borwein: a difference of order $10^{-11}$) or too short a range (Pólya). The common lesson: computations serve to formulate and test conjectures,
but justifying them requires a proof — a traditional one, one checked symbolically in a CAS (within the limits of our trust in the program), or a formal one, checked by the kernel of a proof assistant such as Lean.
Formulas used in the applet: the number of Moser regions for $n$ points in general position is $1 + \binom{n}{2} + \binom{n}{4}$ (each chord adds a region, and each intersection one more);
the prime divisors of $F_n$ ($n\ge 2$) have the form $k\cdot 2^{n+2}+1$; for the Borwein integrals, when $s = \sum_{k=1}^{m} a_k$ exceeds $a_0 = 1$ (but not by too much), we have
$$\int_0^\infty \prod_{k=0}^{m}\operatorname{sinc}(a_k x)\,dx = \frac{\pi}{2}\Bigl(1 - \frac{(s-1)^m}{2^{m-1}\, m!\, \prod_{k=1}^m a_k}\Bigr).$$
Explore on your own
Prove that if $f$ is a nonconstant polynomial with integer coefficients and $f(0) = c \ne \pm 1$, then $c \mid f(kc)$ for every $k$. What does this imply for Euler’s polynomial?
For $n = 6$, turn off general position (equally spaced points). How many regions are there, and why fewer than 31?
Why does $\gcd(f(n), g(n))$ divide the resultant $\operatorname{Res}(f, g)$? (Hint: there exist polynomials $u, v \in \mathbb{Z}[x]$ with $uf + vg = \operatorname{Res}(f,g)$.)
In the Borwein table, check by hand that $\frac13+\frac15+\dots+\frac1{13} < 1 < \frac13+\dots+\frac1{15}$.