EditSafely

Generate Stanley Number Sequence

Create a list of Stanley numbers.

Runs on your device, nothing uploaded

Presets:
How many terms
Separator

Output

Generating…

This runs entirely on your device

Generate Stanley Number Sequence is JavaScript that your browser has already downloaded, and it does the whole job on your own machine. Nothing is requested from a server, so the result you see has never existed anywhere but here.

  • No server involved
  • Generated on your device
  • Works offline once loaded
  • Nothing stored or logged

How to use Generate Stanley Number Sequence

  1. 1. Set how many terms. Enter How many terms to decide how many Stanley numbers to list, values whose base-3 representation uses only the digits 0 and 1, giving a sequence with no three-term arithmetic progression.
  2. 2. Set a separator. Choose Separator, a comma or newline, to shape the output for a plain list or spreadsheet column.
  3. 3. Copy the results. The tool filters numbers to those whose base-3 digits avoid the digit 2 entirely. Copy the resulting Stanley numbers for your combinatorics or number theory reference.

When to use Generate Stanley Number Sequence

Generate Stanley Number Sequence lists integers whose base-3 representation contains only 0s and 1s, producing a sequence famous for containing no three-term arithmetic progression. Reach for it whenever you need this specific sequence without converting numbers to base 3 and checking digits by hand.

  • Studying arithmetic-progression-free sequences. A combinatorics student exploring sequences that deliberately avoid arithmetic progressions references the Stanley sequence as the classic example built from restricted base-3 digits.
  • Testing a base-3 digit filter. A developer who wrote a function to filter numbers whose base-3 expansion excludes the digit 2 validates its output against this generated sequence to catch a base-conversion error.
  • Comparing against the Moser-de Bruijn sequence. Someone studying how restricting digits in different bases produces structurally similar sequences compares Stanley numbers, built from base-3 digit restrictions, against Moser-de Bruijn numbers built from base 4.
  • Preparing an additive combinatorics example. An instructor covering additive combinatorics and progression-free sets uses the Stanley sequence as a concrete, easily verified example before introducing more advanced constructions.

Examples

The first ten Stanley numbers

Output

0, 1, 3, 4, 9, 10, 12, 13, 27, 28

About the Generate Stanley Number Sequence tool

Generate Stanley Number Sequence does its work locally, right in the browser. Create a list of Stanley numbers. There is no upload step, no queue and no account, and your data never travels over the network.

It belongs to the Math Tools collection on EditSafely, a set of 234 small, focused Math utilities that share the same instant, private workspace.

You can shape the output with 3 settings, including How many terms, Show base 3 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.

Running locally also makes the tool fast and dependable: results appear as soon as your input does, there is no server outage that can take it down mid-task, and confidential data can be processed without a second thought.

Frequently asked questions

Is Generate Stanley Number Sequence free to use?

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

Does the generator send anything to a server?

Everything happens locally. Your browser downloads the tool's code once, then does all the processing itself; nothing you enter is transmitted, stored or logged. You can even go offline after the page loads and it will still work.

How do I get a different result?

Change a setting. The result is worked out from the settings alone, so the same settings always give the same result, and a change shows up immediately.

Do I need to sign up or install anything?

No. The tool works in any modern browser on desktop, tablet or phone. There is no account to create, no extension to add and no software to install.

How do I use the result?

The output panel has a one-click Copy button, and Download saves the result as a file.

Related tools

All Math Tools →