Free Online Utility • MATH Studio • Exact BigInt Engine

Generate Baum-Sweet Sequence

Generate the Baum–Sweet automatic binary sequence (OEIS A086747: 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, ...) where b(n) = 1 iff binary n has no odd-length block of consecutive zeros.

Formula & Quick Reference Live Engine
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
00
311
4100
OEIS A086747 • Even-Length Zero-Run Binary Sequence
Baum–Sweet Sequence

        
Instant client-side computation • Exact sequence math OEIS Verified

Session Calculation Log

No entries recorded in this session yet.

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

  1. 1Set count (1–4,096) and delimiter.
  2. 2Check 'Show binary proof per term' to see each n in binary alongside b(n).
  3. 3Copy or export JSON/TXT.

Reference Examples & Worked Benchmarks

nBinaryZero Blocksb(n)
00Convention1
311None1
4100Length 2 (even)1
5101Length 1 (odd)0
91001Length 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.

Frequently Asked Questions

Why is b(4) = 1 while b(2) = 0?
In binary, 4 = 100 has a block of two zeros (even length → 1), while 2 = 10 has a single zero (odd length → 0).