Generate Paperfolding Sequence

Generate the regular paperfolding sequence — the binary sequence produced by repeatedly folding a strip of paper in half. Also known as the dragon curve sequence: 1, 1, 0, 1, 1, 0, 0, 1, ...

Options
Paperfolding Sequence Options
Start generating paperfolding numbers from this element.
How many iterations to generate?
Delimiter among sequence elements.
(Newline by default.)
Output (Paperfolding Sequence)

What It Does

Generate the regular paperfolding sequence — the binary sequence produced by repeatedly folding a strip of paper in half. Also known as the dragon curve sequence: 1, 1, 0, 1, 1, 0, 0, 1, ...

How It Works

Generate Paperfolding 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 the dragon curve fractal
  • Research automatic sequences
  • Explore paperfolding geometry
  • Generate binary sequences with fractal properties
  • Educational demonstration of physical-mathematical connections

How to Use

  1. Specify term count.
  2. Click Generate.
  3. View sequence.
  4. Copy.

Features

  • Generates the regular paperfolding sequence
  • Connection to dragon curve
  • Binary representation
  • Self-similar structure display
  • Large sequence support

Examples

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

Input
n: 8
Output
1 1 0 1 1 0 0 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 Paperfolding 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 Paperfolding 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

Fold a strip of paper in half repeatedly (always the same direction). Unfold and read the fold directions — that is this sequence.

The Paperfolding Sequence

Take a strip of paper and fold it in half from right to left, repeatedly. Unfold and record each fold direction (up=1, down=0). The sequence of fold directions is: 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, .... This sequence generates the dragon curve fractal when used as turn directions.

Frequently Asked Questions

How is it related to the dragon curve?

Using 1 as 'turn right' and 0 as 'turn left', the paperfolding sequence draws the dragon curve fractal.

Is it periodic?

No, but it has a recursive self-similar structure.

Is it automatic?

Yes. It is a 2-automatic sequence.

How many terms from n folds?

n folds produce 2^n - 1 terms.

What is the pattern?

Insert 1s and 0s alternately between the terms of the previous iteration.

Who studied it?

Many mathematicians including Davis and Knuth studied its properties.