Complete Technical Guide to Generate Ulam Number Sequence
Introduced by Stanislaw Ulam in 1964, the Ulam sequence U(1, 2) = 1, 2, 3, 4, 6, 8, 11, 13, 16, 18, 26, ... (OEIS A002858) is formed greedily by always selecting the smallest next integer that is the sum of two distinct earlier terms in exactly one way.
Despite its elementary definition, U(1, 2) exhibits mysterious hidden periodicity modulo ≈ 2.44344 discovered by Steinerberger in 2015—and you can explore both U(1, 2) and custom seeds U(u, v) live.
Ulam's Unique Representation Rule (1964)
U₁ = u, U₂ = v (classic: u = 1, v = 2)
U_n = smallest integer > U_{n-1} representable in EXACTLY ONE way as U_i + U_j (i < j)
Classic U(1, 2): 1, 2, 3, 4, 6, 8, 11, 13, 16, 18, 26, 28, 36, 38, 47, 48, ...
Each newly accepted term U_k increments the sum-count table for every pair U_i + U_k, and the next term is the smallest candidate whose representation count equals exactly 1.
How to Use Generate Ulam Number Sequence
- 1Pick a quick preset or enter any term count up to 800.
- 2Choose comma, space, or newline separation and optionally toggle 1-based term indexing.
- 3Copy plain text, export structured JSON, or download a .txt file with one click.
Reference Examples & Worked Benchmarks
| Index / Milestone | Exact Term | Notes |
|---|---|---|
| Why 5 is skipped | 5 = 1+4 = 2+3 | Two distinct sums → excluded |
| Why 6 is included | 6 = 2+4 only | Unique sum → U₅ = 6 |
| Why 7 is skipped | 7 = 1+6 = 3+4 | Two distinct sums → excluded |
Practical Applications & Engineering Workflows
Combinatorics & Number Theory
Generate verified terms of OEIS A002858 instantaneously for proofs, OEIS lookups, and test fixtures.
Algorithm & Curriculum Verification
Cross-check exact BigInt outputs without floating-point overflow past 2^53.
Accuracy, Edge Cases & Best Practices
- All calculations run locally in your browser using exact BigInt / sieve arithmetic matching OEIS A002858.
All calculations execute locally inside your browser using JavaScript with zero server round-trips, guaranteeing instant responsiveness and complete data privacy.