Generate Baum-Sweet Sequence

Generate the Baum-Sweet sequence — a binary sequence where B(n)=1 if the binary representation of n contains no block of consecutive zeros of odd length, and B(n)=0 otherwise.

Options
Baum-Sweet Sequence Options
Starting index for the Baum-Sweet sequence.
How many elements to generate?
Delimiter among sequence elements.
(Newline by default.)
Output (Baum-Sweet Sequence)

What It Does

Generate the Baum-Sweet sequence — a binary sequence where B(n)=1 if the binary representation of n contains no block of consecutive zeros of odd length, and B(n)=0 otherwise.

How It Works

Generate Baum-Sweet Sequence produces new output from rules, parameters, or patterns instead of editing an existing document. That makes input settings more important than input text, because the settings are what define the shape of the result.

Generators are only as useful as the settings behind them. When the output seems off, check the count, range, delimiter, seed values, or pattern options before judging the result itself.

All processing happens in your browser, so your input stays on your device during the transformation.

Common Use Cases

  • Study automatic sequences in formal language theory
  • Research number-theoretic properties of binary representations
  • Explore connections between sequences and formal power series
  • Generate reference data for combinatorics research
  • Educational exploration of binary-defined sequences

How to Use

  1. Specify how many terms.
  2. Click Generate.
  3. View the sequence.
  4. Copy results.

Features

  • Generates terms of the Baum-Sweet sequence
  • Shows binary representations
  • Highlights zero-block analysis
  • Large sequence support
  • Mathematical explanation for each term

Examples

Below is a representative input and output so you can see the transformation clearly.

Input
n: 10
Output
1 1 0 1 0 0 0 1 1 1

Edge Cases

  • Very large inputs can still stress the browser, especially when the tool is working across many numbers. Split huge jobs into smaller batches if the page becomes sluggish.
  • Empty or whitespace-only input is technically valid but may produce unchanged output, which can look like a failure at first glance.
  • If the output looks wrong, compare the exact input and option values first, because Generate Baum-Sweet Sequence should be repeatable with the same settings.

Troubleshooting

  • Unexpected output often means the input is being split or interpreted at the wrong unit. For Generate Baum-Sweet Sequence, that unit is usually numbers.
  • If a previous run looked different, check for hidden whitespace, changed separators, or a setting that was toggled accidentally.
  • If nothing changes, confirm that the input actually contains the pattern or structure this tool operates on.
  • If the page feels slow, reduce the input size and test a smaller sample first.

Tips

B(0)=1, B(1)=1, B(2)=0, B(3)=1, B(4)=1, B(5)=0. Check binary: 2=10 has one zero (odd block), so B(2)=0.

The Baum-Sweet Sequence

The Baum-Sweet sequence is defined by examining the binary representation of each non-negative integer. If every run of consecutive zeros in the binary form has even length, the term is 1; otherwise 0. For n=0 (no zeros), B(0)=1. For n=4=100 (two zeros in a row, even length), B(4)=1. For n=2=10 (one zero, odd length), B(2)=0.

Properties

The Baum-Sweet sequence is 2-automatic — it can be computed by a finite automaton reading the binary digits of n. It was introduced by Baum and Sweet in 1976 in the study of algebraic power series over finite fields.

Frequently Asked Questions

What are the first terms?

1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1.

What makes this sequence special?

It is one of the simplest examples of a 2-automatic sequence with connections to algebraic power series over GF(2).

How is it computed?

Convert n to binary, examine all runs of zeros. If any run has odd length, B(n)=0. Otherwise B(n)=1.

Is it periodic?

No. The Baum-Sweet sequence is not eventually periodic.

What is a 2-automatic sequence?

A sequence computable by a finite automaton that reads input in base 2. Many famous sequences (Thue-Morse, Rudin-Shapiro) are automatic.

Who discovered it?

Leonard Baum and M.M. Sweet introduced it in 1976.