depth n 4squares 8n4,096area (8/9)n62.4%dimension log8/log3 1.8928
🟪 Sierpiński Carpet
The Sierpiński carpet is the real 2D analogue of the 3D Menger sponge: instead of subdividing a cube into a 3×3×3 grid of 27 sub-cubes and removing the center plus the six face-center cubes (20 kept of 27), the carpet subdivides a square into a 3×3 grid of 9 sub-squares and removes only the single center square (8 kept of 9). It is a cross-section, one dimension down, of the same construction rule.
N(n) = 8n filled squares after n iterations. A(n) = (8/9)n · A0 remaining area after n iterations. D = log(8)/log(3) ≈ 1.8928 the fractal (Hausdorff) dimension, between a line (1) and a filled plane (2) — the exact 2D counterpart of the sponge's D = log(20)/log(3) ≈ 2.7268.
Drag to pan, scroll or pinch to zoom, and use the depth slider to change n. Animate cycles the recursion from a plain square up to the chosen depth and back, so you can watch each level's holes open up inside the eight squares that survived the previous level.