All Tools
Categories
Number Tools 69 XML Tools 64 Email Marketing Tools 55 Import-Export Tools 50 JSON Tools 45 Text Tools 13 Shipping Freight Tools 5 Calculator 4
About Contact Privacy

Moser-de Bruijn Numbers Generator

Generate Moser-de Bruijn numbers - the sequence 0, 1, 4, 5, 16, 17... of numbers whose base-4 digits are only 0 or 1. Start index, count, base-4 rendering, BigInt, copy or download. Runs in your browser. Free.

Parameters
1 - 10,000
Term m = the bits of m read as base-4 digits. Every value has only 0s and 1s in base 4 — check the quaternary column.
Sequence

          

About Moser-de Bruijn Numbers Generator

Write a number in base 4 and forbid the digits 2 and 3: you get 0, 1, 4, 5, 16, 17, 20, 21, 64, 65, 68, 69, 80... — the Moser-de Bruijn numbers, the sums of distinct powers of 4. The sequence is 2-automatic, part of the Stanley family, and carries one of the prettiest structural laws in additive number theory: every integer splits uniquely as a plus twice b with both parts in the set.

Moser-de Bruijn Numbers Generator builds the sequence term by term by translating binary into base 4 — term m is the bits of m read as quaternary digits. Choose a start index and a count, inspect the base-4 form on every row, and copy or download the complete list. BigInt values stay exact at any size.

Features

  • Exact construction: Term m = binary(m) read as base-4 digits — an O(log m) BigInt translation.
  • Start anywhere: Continue from any index, up to a million, with up to 10,000 consecutive terms.
  • Base-4 on every row: The digit string 0/1 that defines the set is rendered for each term.
  • BigInt exactness: No floating point anywhere; hundreds of digits stay exact.
  • Copy or download: One click exports the whole run as index = value lines.
  • Reference tab: The splitting law, the Stanley identity, the 2-automaton and the powers-of-4 view.
  • Free and private: Everything runs locally — nothing is uploaded, stored or logged.

How to Use

  1. Set the start index — which term m to begin with (0 to 1,000,000).
  2. Set the count — how many consecutive terms to generate (1 to 10,000).
  3. Generate — rows appear with index, value and base-4 digits.
  4. Watch the structure — every base-4 form is a string of only 0s and 1s.
  5. Copy or download — the complete run for analysis or reuse.

Examples

Example 1 — The opening. Start 0, count 8: 0, 1, 4, 5, 16, 17, 20, 21. Their base-4 forms — 0, 1, 10, 11, 100, 101, 110, 111 — mirror the binary counting of the indexes.

Example 2 — The doubling pattern. Generate 16 terms and observe the blocks: the first eight terms are exactly half of the second eight, which share the base-4 leading digit 1.

Example 3 — The splitting law in action. Pick 17 in the list: 17 = 1 + 2 x 8 — and 1 and 8 are both members of the sequence, exactly as the splitting theorem promises.

Example 4 — Big terms. Start 5000, count 6: the values jump past 10^24 with base-4 forms that are pure 0/1 strings of 40+ digits.

Example 5 — Cross-check with Stanley. Run the Stanley generator with count 12 and compare: the lists are identical, proving the greedy 3-term-free rule produces the same set.

Benefits

  • Instant generation: Any run of the sequence in one click, no manual base conversion.
  • Definition visible: The base-4 0/1 structure on every row teaches the property by inspection.
  • Arbitrary scale: BigInt translation means the numbers keep growing with zero loss of precision.
  • Text-ready output: Index = value lines paste directly into spreadsheets or papers.
  • Structural insight: The reference tab connects the set to Stanley sequences and additive number theory.
  • Private by design: Nothing leaves the browser; no uploads, no logs.

Frequently Asked Questions

What are Moser-de Bruijn numbers?
The numbers whose base-4 representation uses only the digits 0 and 1: 0, 1, 4, 5, 16, 17, 20, 21, 64... Equivalently, sums of distinct powers of 4. The sequence bears the names of Leo Moser and Nicolaas de Bruijn, who studied it in the 1960s.
How are they generated here?
Term m is built by writing m in binary and reading those bits as base-4 digits: m = 2 gives binary 10, read as 4, so 4 is the third term. The tool ramps m from your start index, so every term comes out in logical order.
What is the famous splitting property?
Every nonnegative integer n has a unique representation n = a + 2b where a and b are Moser-de Bruijn numbers. That property drives applications from coding theory to the representation of the nonnegative integers by sums of four squares of this set.
What do the rows show?
The term index, the value, and the base-4 representation — a string of 0s and 1s that makes the defining property visible. Copy and Download export clean index = value lines.
How large can the terms get?
Arbitrarily large. The tool computes in BigInt, and the base-4 form renders exactly at any size — term 5000 already has about 25 digits, all exact.
Any relation to other classic sequences?
Yes — this IS the Stanley sequence S(0, 1, 4): the same numbers arise by the greedy rule that never permits a 3-term arithmetic progression. The Stanley generator on this site builds them from that very different definition.
Is anything stored or uploaded?
No. Values and their base-4 renderings are computed entirely in your browser. Nothing is sent to a server, saved or logged. Copy or download before closing the tab.