In mathematics the regular paperfolding sequence, also known as the dragon curve sequence, is an infinite automatic sequence of 0s and 1s defined as the limit of the following process: At each stage an alternating sequence of 1s and 0s is inserted between the terms of the previous sequence. The sequence takes its name from the fact that it represents the sequence of left and rightfolds along a strip of paper that is folded repeatedly in half in the same direction. If each fold is then opened out to create a right-angled corner, the resulting shape approaches the dragon curve fractal. For instance the following curve is given by folding a strip four times to the right and then unfolding to give right angles, this gives the first 15 terms of the sequence when 1 represents a right turn and 0 represents a left turn. Starting at n = 1, the first few terms of the regular paperfolding sequence are:
Properties
The value of any given term tn in the regular paperfolding sequence can be found recursively as follows. If n = m·2k where m is odd then Thus t12 = t3 = 0 but 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 substitutionrules as follows: 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: which shows that the paperfolding word can be constructed as the limit of another iterated process as follows: 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 From the construction of the paperfolding sequence it can be seen that G satisfies the functional relation
Substituting into the generating function gives a real number between and whose binary expansion is the paperfolding word This number is known as the paperfolding constant and has the value
General paperfolding sequence
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, we can define a general paperfolding sequence with folding instructions. For a binary wordw, let w‡ denote the reverse of the complement of w. Define an operator Fa as and then define a sequence of words depending on the by w0 = ε, 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 which may be used as a definition of a paperfolding sequence.
Properties
A paperfolding sequence is not ultimately periodic.
A paperfolding sequence is 2-automatic if and only if the folding sequence is ultimately periodic.