Free Online Utility • MATH Studio • Exact BigInt Engine

Generate Lucky Number Sequence

Generate Stanislaw Ulam's Lucky number sequence (OEIS A000959: 1, 3, 7, 9, 13, 15, 21, 25, 31, 33, 37...) via the iterative position-elimination lucky sieve.

Formula & Quick Reference Live Engine
Start with all positive integers: 1, 2, 3, 4, 5, 6, 7, ...
Step 1: Delete every 2nd number → 1, 3, 5, 7, 9, 11, 13, 15, ...
Step 2: Next survivor is 3 → delete every 3rd remaining → 1, 3, 7, 9, 13, 15, ...
First 61, 3, 7, 9, 13, 15
7th..10th21, 25, 31, 33
AsymptoticL(n) ~ n ln(n)
EXACT INTEGER SEQUENCE · OEIS A000959
Generate Lucky Number Sequence

        
100% client-side exact mathematics Instant

Session Calculation Log

No entries recorded in this session yet.

Complete Technical Guide to Generate Lucky Number Sequence

Introduced by Gardiner, Lazarus, Metropolis, and Stanislaw Ulam in 1956, the Lucky numbers (OEIS A000959: 1, 3, 7, 9, 13, 15, 21, 25, 31, 33, 37, 43, ...) survive an infinite Josephus-like elimination sieve.

Lucky numbers exhibit uncanny parallels with prime numbers—obeying an analogous Prime Number Theorem, twin-lucky conjectures, and Goldbach-style additive properties.

Stanislaw Ulam's Lucky Number Sieve (1955)

Start with all positive integers: 1, 2, 3, 4, 5, 6, 7, ...
Step 1: Delete every 2nd number → 1, 3, 5, 7, 9, 11, 13, 15, ...
Step 2: Next survivor is 3 → delete every 3rd remaining → 1, 3, 7, 9, 13, 15, ...
Step 3: Next survivor is 7 → delete every 7th remaining → 1, 3, 7, 9, 13, 15, 21, ...

Unlike the Sieve of Eratosthenes (which removes multiples of primes), the Lucky sieve removes elements by their current surviving index—yet remarkably shares the exact same asymptotic density ~ n / ln(n) as the prime numbers!

How to Use Generate Lucky Number Sequence

  1. 1Pick a quick preset or enter any term count up to 2,500.
  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
First 61, 3, 7, 9, 13, 155 and 11 eliminated at step 2
7th..10th21, 25, 31, 3319 eliminated at step 3 (7th)
AsymptoticL(n) ~ n ln(n)Same growth rate as primes!

Practical Applications & Engineering Workflows

Combinatorics & Number Theory

Generate verified terms of OEIS A000959 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 A000959.

All calculations execute locally inside your browser using JavaScript with zero server round-trips, guaranteeing instant responsiveness and complete data privacy.

Frequently Asked Questions

How is the Lucky sieve different from the Sieve of Eratosthenes?
Eratosthenes deletes multiples of the value p, whereas Ulam's Lucky sieve deletes every p-th surviving position in the remaining list.
Are Lucky numbers the same as Happy numbers?
No—Happy numbers are defined by iterating the sum of squared digits until reaching 1, whereas Lucky numbers come from Ulam's elimination sieve.