Complete Technical Guide to Generate Baum-Sweet Sequence
Introduced by Leonard Baum and Melvin Sweet in 1976 (OEIS A086747), the Baum–Sweet sequence sets b(0) = 1 and b(n) = 1 whenever the binary expansion of n contains no block of consecutive 0s of odd length, and b(n) = 0 otherwise.
Generate up to 4,096 terms instantaneously, toggle binary run-length inspection per index, and export as plain text, JSON, or TXT.
Baum–Sweet Definition & Recurrence
b(0) = 1 b(n) = 1 if binary(n) has ONLY even-length blocks of 0s (or no 0s at all) b(n) = 0 otherwise 2-Automatic Recurrence: b(2n+1) = b(n), b(4n) = b(n), b(4n+2) = 0
Because 4 in binary is `100` (one block of TWO zeros), b(4) = 1; whereas 5 is `101` (one block of ONE zero), so b(5) = 0.
How to Use Generate Baum-Sweet Sequence
- 1Set count (1–4,096) and delimiter.
- 2Check 'Show binary proof per term' to see each n in binary alongside b(n).
- 3Copy or export JSON/TXT.
Reference Examples & Worked Benchmarks
| n | Binary | Zero Blocks | b(n) |
|---|---|---|---|
| 0 | 0 | Convention | 1 |
| 3 | 11 | None | 1 |
| 4 | 100 | Length 2 (even) | 1 |
| 5 | 101 | Length 1 (odd) | 0 |
| 9 | 1001 | Length 2 (even) | 1 |
Practical Applications & Engineering Workflows
Formal Languages & Automata
Study 2-automatic sequences generated by a 4-state deterministic finite automaton.
Continued Fractions over GF(2)
The generating series Σ b(n)x^n satisfies f³ + x·f + 1 = 0 in F₂((x)).
Accuracy, Edge Cases & Best Practices
- Asymptotic density of 1s approaches 0 as N → ∞ (count of 1s up to N grows like O(N^(log₂φ))).
All calculations execute locally inside your browser using JavaScript with zero server round-trips, guaranteeing instant responsiveness and complete data privacy.