In mathematics the regular paperfolding sequence, also known as the dragon curve sequence, is an infinite sequence of 0s and 1s. It is obtained from the repeating partial sequenceby filling in the question marks by another copy of the whole sequence. The first few terms of the resulting sequence are:
If a strip of paper is folded repeatedly in half in the same direction,
i
2i-1
2i-1
The value of any given term
tn
n=1
n
n=m ⋅ 2k
m
t12=t3=0
t13=1
The paperfolding word 1101100111001001..., which is created by concatenating the terms of the regular paperfolding sequence, is a fixed point of the morphism or string substitution rules
11 → 1101
01 → 1001
10 → 1100
00 → 1000
as follows:
11 → 1101 → 11011001 → 1101100111001001 → 11011001110010011101100011001001 ...
It can be seen from the morphism rules that the paperfolding word contains at most three consecutive 0s and at most three consecutive 1s.
The paperfolding sequence also satisfies the symmetry relation:
tn= \begin{cases}1&ifn=2k
\\ 1-t | |
2k-n |
&if2k-1<n<2k \end{cases}
which shows that the paperfolding word can be constructed as the limit of another iterated process as follows:
1
1 1 0
110 1 100
1101100 1 1100100
110110011100100 1 110110001100100
In each iteration of this process, a 1 is placed at the end of the previous iteration's string, then this string is repeated in reverse order, replacing 0 by 1 and vice versa.
The generating function of the paperfolding sequence is given by
G(tn;x)=\sum
infty | |
n=1 |
n | |
t | |
nx |
.
From the construction of the paperfolding sequence, it can be seen that G satisfies the functional relation
G(tn;x)=
2) | |
G(t | |
n;x |
+
infty | |
\sum | |
n=0 |
x4n+1=
2) | |
G(t | |
n;x |
+
x | |
1-x4 |
.
Substituting into the generating function gives a real number between and whose binary expansion is the paperfolding word
G(t | ||||
|
infty | |
)=\sum | |
n=1 |
tn | |
2n |
This number is known as the paperfolding constant and has the value
infty | |
\sum | |
k=0 |
| ||||||
|
=0.85073618820186...
The regular paperfolding sequence corresponds to folding a strip of paper consistently in the same direction. If we allow the direction of the fold to vary at each step we obtain a more general class of sequences. Given a binary sequence (fi), we can define a general paperfolding sequence with folding instructions (fi).
For a binary word w, let w‡ denote the reverse of the complement of w. Define an operator Fa as
Fa:w\mapstowaw\ddagger
and then define a sequence of words depending on the (fi) by w0 = ε,
wn=
F | |
f1 |
(
F | |
f2 |
( …
F | |
fn |
(\varepsilon) … )) .
The limit w of the sequence wn is a paperfolding sequence. The regular paperfolding sequence corresponds to the folding sequence fi = 1 for all i.
If n = m·2k where m is odd then
tn= \begin{cases}fj&ifm\equiv1\mod4\\ 1-fj&ifm\equiv3\mod4 \end{cases}
which may be used as a definition of a paperfolding sequence.[1]