Free Online Utility • Interactive Fractal Studio • 2× HiDPI + SVG Engine

Toothpick Fractal

Simulate David Applegate, Omar Pol, and N. J. A. Sloane's OEIS A139250 Toothpick Sequence from Generation 1 to 64 with exposed-tip highlighting, exact toothpick counts T(n), growth animation, and SVG/PNG export.

Toothpick Generation (n)32
Stroke / Detail1.8px
Rotation Angle0°
Mathematical Specification Fractal Studio
OEIS A139250 Toothpick Automaton (Pol & Sloane, 2009):
Gen 1: Place 1 vertical toothpick of length 2 at (0,0)
Gen k: At every exposed endpoint (touched by no other midpoint/end),
place a perpendicular toothpick centered at that tip!
At n = 2^k: Total Toothpicks T(2^k) = (4^(k+1) − 1) / 3
OEIS IdentifierA139250 (Total) / A139251 (Added)
Power-of-2 MilestonesT(16)=85 | T(32)=341 | T(64)=1,365
DiscoverersOmar E. Pol & N. J. A. Sloane (2009)
INTERACTIVE 2× HIDPI CANVAS
Toothpick Fractal
100% • Scroll to Zoom • Drag to Pan
Client-side 2× HiDPI + Lossless SVG Engine Instant

Session Calculation Log

No entries recorded in this session yet.

Mathematical Foundations of Toothpick Fractal

Introduced by Omar E. Pol and analyzed with David Applegate and OEIS founder N. J. A. Sloane in 2009 (OEIS A139250), the Toothpick Sequence begins with a single vertical toothpick on the plane. At each generation, a perpendicular toothpick is centered on every exposed toothpick endpoint that touches no other toothpick.

Self-similar fractals exhibit recurring geometric structure across scales, governed by Iterated Function Systems (IFS), Lindenmayer L-System rewriting rules, or recursive spatial subdivisions. Every geometry calculation, 2× HiDPI canvas pass, progressive animation frame, and lossless SVG vector export executes natively inside your browser at 60 FPS with zero server latency.

Exact OEIS A139250 Recursive Lattice Growth

Generation 1: T(1) = 1 vertical segment [(0,-1) to (0,1)]
At generation n:
  An endpoint P is EXPOSED iff exactly 1 toothpick endpoint lies at P and no midpoint covers P.
  Place a perpendicular toothpick of length 2 centered at every exposed P.
Power-of-2 Closure Law:
  At n = 2^k, the structure forms a nearly solid square with T(2^k) = (4^(k+1) - 1) / 3
  and only the 4 outer corner tips remain exposed (so T(2^k + 1) - T(2^k) = 4)!

Slide the Generation slider to 16, 32, or 64 and watch the "+ new" counter: at Generation 16 (85 toothpicks), Generation 32 (341 toothpicks), and Generation 64 (1,365 toothpicks), the square closes up completely, leaving only 4 exposed corner tips for the next generation!

Iteration Scaling & Complexity Table

Iteration / SettingElements / SizeGeometric Property
Gen 1T(1) = 1 (+1 new)Single vertical seed toothpick
Gen 4T(4) = 11 (+4 new)First 2×2 H-tree square closure
Gen 8T(8) = 23 (+4 new)4×4 recursive corner bottleneck
Gen 16T(16) = 85 (+4 new)Exact (4^4 - 1)/3 square closure
Gen 32T(32) = 341 (+4 new)Exact (4^5 - 1)/3 square closure
Gen 64T(64) = 1,365 (+4 new)Exact (4^6 - 1)/3 full fractal lattice

Applications in Science, Graphics & Engineering

Experimental Mathematics & OEIS

N. J. A. Sloane ranked the Toothpick Sequence (A139250) among his all-time favorite integer sequences for its self-similar binary Bottleneck pulses.

Binary Hamming Weight Generating Functions

The number of toothpicks added at step n is governed by the binary representation of n via 2-automatic recurrence formulas.

VLSI H-Tree & Metamaterial Routing

Models self-avoiding orthogonal branching waveguides that fill a square domain from a single central feed.

Precision Vector Export

Export any generation from 1 to 64 as a crisp SVG vector diagram with exposed-tip highlights.

Interactive Controls, Pan/Zoom & Vector Export

Step through Generations 1 to 64, observe the gold highlight on newly added toothpicks collapse to just 4 corner picks at powers of two (n = 8, 16, 32, 64), and export vector SVG.

Export crisp 2× Retina PNG renders for presentations or scalable infinite-resolution SVG files directly into Illustrator, Figma, Inkscape, LaTeX, or laser-cutting workflows.

Frequently Asked Questions

What does "exposed endpoint" mean in the Toothpick rule?
An endpoint is exposed if it has never been used before and no second toothpick endpoint simultaneously lands on the exact same coordinate (when two tips meet head-on, both annul each other and stop growing).
Why do only 4 new toothpicks get added after Generation 16, 32, and 64?
At every power of two n = 2^k, all interior branches collide and seal off inside a square of (4^(k+1) - 1)/3 toothpicks, leaving only the 4 outer corner tips exposed!
What do the gold-highlighted toothpicks show?
When Active Generation Highlight is enabled, the toothpicks added during the current generation n are highlighted in bright gold so you can see the active growth wavefront.
Can I animate the Toothpick sequence growing from Gen 1 to Gen 64?
Yes. Click Animate Growth to watch all toothpicks appear in exact chronological generation order.