Drop grains of sand on a grid. When a cell holds 4, it topples and gives one grain to each neighbour, and grains that fall off the edge are lost. Piles like this can be added together, and among the stable ones there is a single pile that acts as zero: add it to any of them, let everything topple, and you get back what you started with. On a square it is a famous fractal. We computed it on the shape of every country.
Pick a shape, a country, or draw your own, then press the button. Your browser does it the slow, honest way: fill every cell with 6 grains and let it topple, take the result away from 6, and let it topple again. What is left is the zero. Then it adds the zero to itself to check that nothing changes.
Each image is the exact identity of the sandpile on that country's outline, drawn in an equal-area projection at about 300 cells across. Click one to watch it form at demo size.
This is the abelian sandpile of Bak, Tang and Wiesenfeld (1987). A cell with 4 or more grains topples. The final stable pile doesn't depend on the order in which cells topple, which Deepak Dhar proved in 1990, and that is the "abelian" part.
Some stable piles are recurrent: you can get back to them from anywhere by adding sand and letting it topple. Dhar showed that the recurrent piles, with "add, then topple" as the operation, form a group. Every group has an identity, and this is it. It is a recurrent pile, not the empty pile, because the empty pile isn't recurrent.
How we compute it. Let 6 be the pile with 6 grains on every cell. Then zero = topple(6 − topple(6)). We wrote a small C stabiliser that topples a cell z//4 times at once, and sped it up with a lower bound on how often each cell must topple (this never changes the answer). Countries are drawn from Natural Earth outlines, with the region's edge as the drain.
Caveats. A country here is its main body plus nearby islands. Far-off islands and territories are dropped, and islands smaller than 0.2% of the main landmass are left out. The pattern depends on the grid, so a different resolution or projection gives a different (but just as exact) zero.