EditSafely

Generate Moser-de Bruijn Sequence

Create Moser-de Bruijn values. Runs entirely in your browser, so your data never leaves your device.

Output

The result appears here as you type.

Options

How to use Generate Moser-de Bruijn Sequence

  1. 1. Set how many terms. Enter How many terms to decide how many Moser-de Bruijn values to list, the sums of distinct powers of 4 that appear in this sequence's base-4 structure.
  2. 2. Set a separator. Choose Separator, a comma or newline, to match the format needed for a plain list or a spreadsheet column.
  3. 3. Copy the results. The tool builds each term as a sum of distinct powers of 4, following the sequence's defining property that every non-negative integer splits uniquely into a Moser-de Bruijn term plus twice another. Copy the list.

When to use Generate Moser-de Bruijn Sequence

Generate Moser-de Bruijn Sequence lists numbers whose base-4 representation uses only the digits 0 and 1, sums of distinct powers of 4. Reach for it whenever you want verified terms of this number theory curiosity without expanding powers of 4 by hand.

  • Studying unique integer decompositions. A number theory student exploring the fact that every non-negative integer can be uniquely written as a Moser-de Bruijn term plus twice another wants concrete terms to test the decomposition property on.
  • Testing a base-4 digit filter. A developer who wrote a function that filters numbers whose base-4 digits are only 0 or 1 validates its output against this generated sequence to catch a base-conversion bug.
  • Cross-referencing OEIS A000695. Someone reading about this sequence in a paper or on OEIS regenerates the early terms here to confirm their manual computation matches the published values.
  • Illustrating powers of 4 in a lesson. An instructor covering how sums of distinct powers of a base can define an entire integer sequence uses the Moser-de Bruijn numbers as a concrete base-4 example.

Examples

The first nine terms

Output

0, 1, 4, 5, 16, 17, 20, 21, 64

About the Generate Moser-de Bruijn Sequence tool

Generate Moser-de Bruijn Sequence runs as plain JavaScript in your browser tab, with no server behind it. Create Moser-de Bruijn values. Whatever you put in stays on your device from start to finish.

The tool is part of EditSafely's Math Tools section, 234 single-purpose utilities built around the same idea: open the page, get the result, keep your data to yourself.

You can shape the output with 2 settings, including How many terms and Separator, and the result refreshes the moment you change one. A worked example further down the page shows exactly what the tool produces for a real input.

That local-first design has practical benefits beyond privacy. The tool keeps working on a flaky connection once the page has loaded, results are instant because nothing round-trips to a server, and it is safe to use with confidential material.

Frequently asked questions

Does Generate Moser-de Bruijn Sequence cost anything?

Yes, it is completely free. All 2,658 tools on EditSafely work without an account, a subscription or usage limits.

Does the generator send anything to a server?

No data leaves your device. The whole tool is JavaScript that runs inside your browser tab, so there is no upload, no server-side processing and no log of what you did. If you disconnect from the internet after the page loads, it keeps working.

How do I get a different result?

Run the generator again. Each run is computed fresh on your device, and any options you change are applied to the next result immediately.

Do I need to sign up or install anything?

Nothing to install and no account needed. Open the page in any up-to-date browser, including on a phone or tablet, and the tool is ready.

How do I use the result?

The output panel has a one-click copy button, and you can keep refining the input while you work; the result updates in place as you type.

Related tools

All Math Tools