Ulam Spiral & Collatz
Explore prime patterns on a Ulam spiral and exact, bounded Collatz sequences.
About this tool
The Ulam spiral places 1 at the center, then 2 to its right and 3 above 2, continuing counterclockwise. Prime numbers use the accent color. Diagonal patterns illustrate prime distribution, not a primality proof. Generate an odd square from 11 to 201 cells per side; size 11 also labels every number. Click a cell, use arrow keys on the plot, or choose its number to inspect it.
Collatz starts at a positive integer: halve an even value, or replace an odd value with 3N+1. The exact integer sequence ends at 1 or at the selected step limit (1–10000). The limit is reported honestly; calculating particular starts does not prove the general conjecture. Starts accept up to 128 decimal digits, an optional + and leading zeroes. Decimals, negative values and zero are rejected, not rounded or clamped.
The horizontal axis counts steps; the vertical axis shows values. Choose linear or logarithmic scale; the step slider and sequence rows reveal exact integers. Long sequences are paged in groups of 100. Plot coordinates are approximate: linear ratios use one million subdivisions, logarithms use leading digits. Large labels use scientific notation, while the peak and selected value stay exact.
Small bounded calculations update directly; Enter updates immediately. Only raw mode, grid size, start, step limit and scale inputs are kept locally, including invalid drafts. Results, selected steps and views are recalculated. The plot uses the available width and adapts to viewport height; square grid cells keep their proportions. PNG exports the current plot. Normal wheel scrolls the page.