Pi out of the stack
An early write-up of this work had a section titled "Pi" that ended in defeat: pi was hunted inside a single carpet's area and never found. The instinct was right and the object was wrong. Pi is here — not in one carpet, but in the stack of carpets, and it comes out as a counted number rather than an assumed one.
Every claim below is tagged. Proved means proved or classical; Verified means recomputed here and reported as measured; Conjecture means supported and open.
A single carpet cannot hold pi
Take any self-similar fractal that keeps k of the b^d subcells at every level. Its filled fraction at level n is exactly (k/b^d)^n — rational at every level, and its limit is 0 or 1. The carpet keeps 8 of 9, the sponge 20 of 27, so the level-n fractions are (8/9)^n and (20/27)^n. No irrational constant can be read off a sequence of that shape. (Proved, elementary.)
The classical fractal that does give pi works differently: the Wallis sieve changes its ratio at every level, so its area is a genuine infinite product,
Product_{n >= 1} (1 - 1/(2*n + 1)^2) = pi/4
recomputed here to 0.785398261 at two million factors against pi/4 = 0.785398163. (Verified, numerics; the identity itself is Wallis, Proved.) A fixed-ratio carpet has one ratio, not a product of changing ones. That is the whole reason the original hunt failed, and it is worth logging so nobody re-chases it.
What the stack lights up
Stack the grid at scales k = 1, 2, 3, .... Every lattice point (a, b) factors uniquely as g * (a/g, b/g) with g = gcd(a, b), so it belongs to exactly one layer of the stack, and the points that appear in the first layer are exactly those with gcd(a, b) = 1 — equivalently, the points visible from the corner, with no nearer lattice point on the same ray. The stack is therefore a partition of the grid into scaled copies of the lit set. (Proved, elementary.) Checked numerically as sum_{k >= 1} lit(floor(N/k)) = N^2, exact at N = 10, 100, 1000, 3000. (Verified.)
The density of those lit points is the classical coprimality density,
lit / N^2 -> 1/zeta(2) = 6/pi^2 = 0.6079271018...
(Proved, classical — Dirichlet and Mertens.) Inverting it turns the picture into an estimator:
pi = sqrt( 6 / density ) = sqrt( 6 * N^2 / lit )
The constant is classical; what the stack adds is a picture, so pi is counted out of the grid rather than imposed on it. The same visibility fact anchors the base-3 story in what base 3 hides.
The numbers
Lit points counted by a totient sieve as 2 * sum_{k=1..N} phi(k) - 1, cross-checked against a brute gcd scan at N = 10, 50, 100, 200 with exact agreement.
| N | lit points | density | pi estimate | abs error |
|---|---|---|---|---|
| 10 | 63 | 0.6300000000 | 3.08606700 | 5.6e-02 |
| 100 | 6087 | 0.6087000000 | 3.13959750 | 2.0e-03 |
| 1000 | 608383 | 0.6083830000 | 3.14041534 | 1.2e-03 |
| 10000 | 60794971 | 0.6079497100 | 3.14153424 | 5.8e-05 |
| 20000 | 243180791 | 0.6079519775 | 3.14152838 | 6.4e-05 |
| 100000 | 6079301507 | 0.6079301507 | 3.14158478 | 7.9e-06 |
| 200000 | 24317197835 | 0.6079299459 | 3.14158531 | 7.3e-06 |
At N = 100000 the stack gives 3.14158..., six correct figures against pi = 3.14159265.... (Verified, recomputed.)
It is a slow estimator and an honestly noisy one. The error term in the coprime count is O(N log N), so accuracy improves only like 1/N, and because that term fluctuates arithmetically the approach is not monotone: N = 20000 is worse than N = 10000 in the table above, and N = 200000 barely improves on N = 100000. (Verified, observed in the run.) That puts it in the same family as the Wallis product and the Leibniz series — correct, convergent, not fast. The point was never speed.
The dimension picks the zeta
The same count in d dimensions has density 1/zeta(d) (Proved, classical, by Mobius inversion). So the stack is a geometric generator for the whole zeta family, and the dimension you stack in decides which constant falls out. Counted by sum_{k=1..N} mu(k) * floor(N/k)^d, cross-checked against brute gcd at N = 10, 40 for d = 2, 3:
| d | density at N = 100000 | limit | constant recovered | true value |
|---|---|---|---|---|
| 2 | 0.6079301507 | 6/pi^2 | pi = 3.14158478 | 3.14159265 |
| 3 | 0.8319084771 | 1/zeta(3) | zeta(3) = 1.20205531 | 1.20205690 |
| 4 | 0.9239388718 | 1/zeta(4) | pi = 3.14159226 via pi = (90/density)^(1/4) | 3.14159265 |
(Verified, recomputed.) Two things follow. The 3D sponge stack does not give pi: it gives Apery's constant zeta(3), which is not known to be a rational multiple of any power of pi — the same parity barrier that blocks Catalan's constant (Conjecture; no impossibility proof exists, and none is expected to be easy). And every even dimension is a fresh pi route: zeta(4) = pi^4/90 recovers pi to seven figures at N = 100000, an order better than the 2D count at the same N. (Verified, observed in the run.)
Where the fractal versions stand
Restricting the count from the full grid to the cells of a fractal keeps the pi but changes the constant. Those restricted densities are recorded in the ledger and every one of them is Conjecture there, not theorem — numerical support with shrinking gaps, no proof of the interchange of limits. Each is a rational multiple of 6/pi^2 (Proved, exact arithmetic on the three values):
| entry | conjectured density | as a multiple of 6/pi^2 |
|---|---|---|
| A396934, Sierpinski triangle | 16/(3*Pi^2) = 0.5403796 | 8/9 |
carpet_coprime | 189/(32*Pi^2) = 0.5984282409 | 63/64 |
vicsek_coprime | 27/(4*Pi^2) = 0.6839179896 | 9/8 |
Nothing on this page upgrades them. The clean result is the unrestricted one: on the full stack the density is a theorem, and pi drops out of it by counting.
The early hunt looked for pi in an area and found a rational. Pi was one level up, in the agreement between scales — and agreement between scales is coprimality.