The Rhythm of Numbers · The paper
The Rhythm of Numbers: Continued Fractions, Primes, Music and Self-Similarity
Teddy Rook · 2026
Everything on the Rhythm of Numbers pages, written up as one long paper, like a thesis: definitions, theorems and proofs, 34 figures, numbered equations and a full bibliography. It also goes further than the pages, with new computations on prime convergents and on the zeros of the zeta function.
⬇ Download the paper (PDF, 86 pages, 1.6 MB)Open it in a new tab
The paper is written for a strong college student or a curious adult: calculus and a first taste of number theory help. Every chapter has a short note on what to show if it is read aloud or filmed.
Abstract
This work grows out of one guess: that pi is close to 3 + k/(7k + 1) for a suitable whole number k. The guess is right at k = 16, where it gives 355/113, the fraction Zu Chongzhi recorded in the fifth century AD, and it is right for a reason: k/(7k + 1) is a continued fraction cut off after two steps. We follow that reason in three directions.
Rhythm. Playing a number as a beat gives a Sturmian word, and we prove that its blocks nest exactly as the continued fraction says: the blocks at each level are as long as the denominators of the convergents. For pi this gives bars of 7 beats, phrases of 106 and 113, and one short phrase that begins at beat 32,996 and closes a block of 33,102 beats. Reading the levels as bar, phrase, section and movement turns a continued fraction into musical form; Teddy Rook used it to compose the Continued-Fraction Suite for piano.
Primes. The same machine builds Euclidean rhythms, tunings, mode-locking staircases and a classical factoring method, and coprimality ties them to 6/π². Two open threads get real computations. For prime convergents we derive a heuristic: a typical number has about 2 ln 2 · ln N ≈ 1.3863 ln N prime denominators among its first N convergents. A sample of 400 random numbers fits it, and pi, with 9 prime denominators among its first 5,000 convergents against 10.9 expected, is typical. For the Montgomery–Dyson connection we place a crystal, the rhythm of pi, 5,000 zeta zeros, random matrices, the primes and random points on one scale of rigidity. The picture organizes the mystery; it proves nothing about the Riemann hypothesis.
Self-similarity. A continued fraction contains a copy of itself after every term, the idea behind Ford circles, the Stern–Brocot tree, Minkowski’s question-mark function, the devil’s staircase, Cantor dust (dimension 0.531280506277), the Mandelbrot set’s Farey bulbs and the Fibonacci word fractal. Pi’s first 10,000 terms pass a chi-square test against the Gauss–Kuzmin law (p = 0.33).
A final audit sorts every idea into classical, specialist, new presentation or new. The mathematics is classical or known; the musical-form reading of whole continued fractions, the Suite, the prime-convergent experiment and the spacing spectrum are what we did not find elsewhere. Every number in the text was computed by the scripts in the appendices.
Contents
Each chapter with a one-line summary, and the places on the site where you can play with its ideas.
- 1
Introduction: a guess about pi
Why 3 + k/(7k + 1) finds 355/113 at k = 16: the guess is a continued fraction stopped after two steps.
Try it on the site: The starting guess
- 2
Continued fractions: the machine
The algorithm, the recurrence for convergents, best approximation, Legendre and Lagrange, and the laws of Gauss–Kuzmin, Khinchin and Lévy.
Try it on the site: The ladder
- 3
The rhythm of a number
Sturmian and Christoffel words, a proof that the blocks nest as the denominators, pi's levels, and what beats 32,996 and 33,102 each count.
Try it on the site: The levels · Composer
- 4
Music from the same ladder
Tunings from the fifth's convergents, the Pythagorean comma, Euclidean rhythms, polyrhythm and mode locking.
Try it on the site: Circle of fifths · Euclid's algorithm · Mode locking · Drum machine
- 5
Coprimality and 6/π²
The orchard, Euler's product, an exact formula for the correlation of two pulse trains, and hydrogen's 1/n² as a shared formula, not shared physics.
Try it on the site: The orchard · Correlation matrix · Hydrogen
- 6
Primes in sound and space
The bias of consecutive primes, pi's prime sunflower, wheels, diffraction of pi's rhythm and of the primes, and the explicit formula.
Try it on the site: Prime music · Sunflower · Quasicrystals · Zeta zeros
- 7
Tools that hunt primes
Continued-fraction factoring, Mersenne necklaces and Fermat's little theorem, and the prime hunt, with its null result.
Try it on the site: Factoring · Mersenne circles · Prime hunt
- 8
Thread (a): prime convergents
A heuristic with the constant 2 ln 2, tested on 400 random numbers and on pi, e, √2, φ and log₂(3/2).
Try it on the site: The ladder
- 9
Thread (b): one spectrum, from crystal to randomness
Spacings, pair correlation and number variance for a crystal, pi's rhythm, 5,000 zeta zeros, random matrices, the primes and random points; Dyson's quasicrystal remark made visible.
Try it on the site: Zeta zeros · Quasicrystals
- 10
Self-similarity and fractals
Teddy Rook's picture of the nested tail, Ford circles, Stern–Brocot, the question-mark function, the devil's staircase, Cantor dust, Farey bulbs, the Fibonacci word fractal, and a Gauss–Kuzmin test of pi.
Try it on the site: Chapter VII: Fractals · Is pi typical? · Six numbers
- 11
Composition: the Continued-Fraction Suite as a method
Form from the continued fraction, each movement's form, and Golden's two-level labels.
Try it on the site: The Suite · Compose a piece · Piano lessons
- 12
Connections: music, patterns, math and chemistry
Newlands' octaves, Chladni figures, crystals and quasicrystals, 2n², drums and orbitals as standing waves.
Try it on the site: The Connections diagram
- 13
What is new here, and what is re-found
A prior-art audit of every idea, from the rhythm of pi (a classical Sturmian word) to the Suite (new music).
- 14
Discussion
What the work shows, its limits, open questions and future work.
Try it on the site: Threads to pull
- A–C
Appendices
Algorithms in pseudocode, computational methods, and how to rebuild every number and figure.
How to cite
Teddy Rook (2026). The Rhythm of Numbers: Continued Fractions, Primes, Music and Self-Similarity. Teddy Rook Book. https://teddyrookbook.com/connections/rhythm-of-numbers/paper/
The PDF itself is at https://teddyrookbook.com/pdfs/The-Rhythm-of-Numbers-paper.pdf. The full source (the text, the bibliography and the Python scripts that compute every number and draw every figure) is kept with the site's source, so the paper can be rebuilt and checked.
Play with it
- The Rhythm of Numbers: pi as a beat, with live instruments, a drum machine and a composer.
- Chapter VII: Fractals: the same rule at every scale.
- The Continued-Fraction Suite: Teddy Rook's six pieces for piano, with the free score and a lesson for each movement.
- Where Music, Patterns, Math and Chemistry Meet: the diagram this work grew from.