Generate Stanley Numbers

Use this tool to create a custom list of Stanley Numbers. You decide how many values to generate, whether to display them line-by-line, and if each number should include its position in the list. The sequence updates instantly as you change settings or input, and you can export or copy the results with a click.

The layout is clean and interactive. You’ll see a flashing preview whenever it updates and a live counter tracks how many numbers are shown.

Total items: 0
Options
Line-by-line output
Show index numbers

How to Use:

  1. Type how many Stanley Numbers you want in the input field.
  2. Use the Options toggles to:
    • Switch between line-by-line or inline output
    • Show or hide index numbers
  3. The output box updates instantly as you type or toggle.
  4. Use “Copy Output” or “Export to File” to save or reuse your results.
  5. Click “Clear All” to reset the tool.

What Generate Stanley Numbers can do:

Stanley Numbers are a simple but neat pattern: 1, 2, 2, 3, 3, 3, 4, 4, 4, 4… and so on. Each number shows up as many times as its value. This tool lets you create that sequence fast, customize how it’s formatted, and even label each value with its position using the “Show index numbers” option.

The layout is clean and interactive, with a built-in counter and live flashing feedback so you can always see what’s happening.

Example:

Input:

12

Settings: Line-by-line: ON, Show index: OFF

Output:

1
2
2
3
3
3
4
4
4
4
5
5

Stanley Number Sequence Table:

This table displays the first 10 Stanley Numbers (OEIS A000070). These numbers count the number of permutations of an n-element set with no increasing subsequence longer than 2. They appear in combinatorics and advanced sequence analysis.

Index (n)Stanley NumberExample Use
01Base case
11Single permutation
22Two items
35Simple combinatorics
414Growth trend
542Recursive pattern
6132Exponential increase
7429Enumerating permutations
81430Math competition use
94862Advanced sequence use

Common Use Cases:

This is useful for generating patterns for teaching math, testing logic in sequences, or just exploring recursive number systems. Stanley Numbers can help demonstrate frequency-based construction and show how numerical patterns can grow predictably.

Useful Tools & Suggestions:

Try Generate Kolakoski Sequence if you want something else that builds on quirky, self-referential logic. And if you’re analyzing growth or repetition, Find Entropy of a Number gives a cool lens into how structured or chaotic things really are.