Tupper’s Self-Referential Formula — It Draws Itself, Then Plays Amazing Grace — manic

Tupper’s Self-Referential Formula — It Draws Itself, Then Plays Amazing Grace.

Jeff Tupper’s formula (from his SIGGRAPH 2001 paper on reliable graphing, the method behind his GrafEq program):

1/2 < floor( mod( floor(y/17) · 2^(−17·floor(x) − mod(floor(y), 17)), 2 ) )

Plot it for 0 ≤ x < 106 and k ≤ y < k + 17, where k is a particular 543-digit number, and it draws its own picture. (As usual for this plot, x runs right to left and y downward.)

How: divide k by 17 to get N, write N in binary, cut it into 106 columns of 17 bits and stand them side by side — that IS the picture. The formula only reads bits back: floor(y/17) finds N, the power of two slides to bit 17x + (y mod 17), and mod 2 reads it. So it is not really self-referential: one strip down, y + 17, the number is N + 1, and every 106 × 17 picture appears somewhere in the plane, at y = 17N for its own N.

The whole scene is one short script — examples/maths-with-music-103-tuppers-formula.manic in the manic repo.

Made with manic — the animation LANGUAGE that turns plain text into precise,
correct animations. No coding, no timeline scrubbing: you describe what you
want and manic animates it — math, physics, optics, algorithms, geometry —
with the diagram actually TRUE, not hand-drawn. One tiny script → this video.

▶ Try it free in your browser: https://maniclang.com
▶ Docs + guides: https://docs.maniclang.com/
▶ Full example gallery: https://app.maniclang.com/gallery

Copy the exact script for this scene in the gallery, change a number, run it —
that’s the power of manic: real animation, in a few lines.

#tupper #maths #binary #amazinggrace #music