Free Online Utility • MATH Studio • Exact BigInt Engine

Generate Ulam Number Sequence

Generate Stanislaw Ulam's unique-sum sequence U(1, 2) (OEIS A002858: 1, 2, 3, 4, 6, 8, 11, 13, 16, 18, 26...) or generalized U(u, v) sequences with custom starting seeds.

Formula & Quick Reference Live Engine
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, ...
Why 5 is skipped5 = 1+4 = 2+3
Why 6 is included6 = 2+4 only
Why 7 is skipped7 = 1+6 = 3+4
EXACT INTEGER SEQUENCE · OEIS A002858
Generate Ulam Number Sequence

        
100% client-side exact mathematics Instant

Session Calculation Log

No entries recorded in this session yet.

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

  1. 1Pick a quick preset or enter any term count up to 800.
  2. 2Choose comma, space, or newline separation and optionally toggle 1-based term indexing.
  3. 3Copy plain text, export structured JSON, or download a .txt file with one click.

Reference Examples & Worked Benchmarks

Index / MilestoneExact TermNotes
Why 5 is skipped5 = 1+4 = 2+3Two distinct sums → excluded
Why 6 is included6 = 2+4 onlyUnique sum → U₅ = 6
Why 7 is skipped7 = 1+6 = 3+4Two 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.

Frequently Asked Questions

Why are 5 and 7 excluded from U(1, 2)?
Because 5 can be written two ways (1+4 and 2+3) and 7 can be written two ways (1+6 and 3+4), violating the unique-representation rule.
Can I change the starting seeds from (1, 2)?
Yes! Enter any positive integers u < v to generate generalized Ulam sequences such as U(1, 3) or U(2, 5).