|
|
A337004
|
|
Turn sequence of the R5 dragon curve.
|
|
2
|
|
|
1, 1, -1, -1, 1, 1, 1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, -1, -1, -1, 1, 1, -1, -1, 1, 1, 1, -1, -1, 1, 1, 1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, -1, -1, -1, 1, 1, -1, -1, 1, 1, 1, -1, -1, 1, 1, 1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, -1, -1, -1, 1, 1, -1, -1, -1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1
|
|
COMMENTS
|
The R5 dragon curve is a segment replacement where each segment expands to
-1 4---E
|
-1 3---2 +1
|
S---1 +1
S and E are the start and end points of the existing segment. New points 1,2,3,4 are inserted between them. The new turns are +1,+1, -1,-1, where +1 is left and -1 is right. The directions of the first and last segments mean existing turns at S and E are unchanged.
Existing: + + - ...
Additional: ++-- ++-- ++-- ++-- ...
The curve is drawn by a unit step forward, turn left a(1)*90 degrees, another unit step forward, turn left a(2)*90 degrees, and so on. (The same way as Joerg Arndt in A175337.)
It's convenient to number points in the curve starting n=0 at the origin, so an expansion level is points 0 to 5^k inclusive. The first turn is then at n=1. The new turns on each expansion are at n == 1,2,3,4 (mod 5) and the existing turns become n == 0 (mod 5). So a(n) is determined by removing base 5 low 0 digits until reaching a digit 1,2,3,4 (formula below).
The segment expansion is symmetric in 180-degree rotation. Or equivalently the new turns +1,+1, -1,-1 are unchanged by flip +1 <-> -1 and read last to first. This means expansions can equally well be considered as unfoldings in the manner of Dekking's folding product (DDUU)*. Each "downward" fold D is +1 and each "upward" fold U is -1.
|
|
LINKS
|
Donald E. Knuth, Selected Papers on Fun and Games, CSLI Lecture Notes Number 192, CSLI Publications, 2010, ISBN 978-1-57586-585-0, pages 603-614 addendum to reprint of Number Representations and Dragon Curves. Example (DDUU)*3 drawn page 607.
|
|
FORMULA
|
a(n) = 1 if A277543(n) = 1 or 2, or a(n) = -1 otherwise, where A277543(n) is the lowest non-0 digit of n written in base 5.
a(n) = 1 or -1 according as A175337(n-1) = 0 or 1 respectively.
Morphism 1 -> 1,1,-1,-1,1 and -1 -> 1,1,-1,-1,-1 starting from 1.
G.f.: Sum_{k>=0} (x^(5^k) + x^(2*5^k) - x^(3*5^k) - x^(4*5^k)) / (1 - x^(5^(k+1))).
|
|
PROG
|
(PARI) a(n) = my(r); until(r, [n, r]=divrem(n, 5)); if(r<=2, 1, -1);
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,sign
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|