OFFSET
1
COMMENTS
A Babylonian Wurm is constructed by starting at (0,0) with a unit vector pointing North and then a clockwise turn with the root 2 length vector pointing NE. For subsequent segments, progressively concatenate the next longer vector with integral endpoints on a Cartesian grid. (The squares of the lengths of these vectors are A001481.) The direction of the new vector is chosen to minimize the change in direction from the previous vector. If there is a tie, the direction will be chosen so the wurm continues to turn in the same direction as the previous turn. - Gordon Hamilton, Mar 17 2015
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . 2 . 3 . . . . . . . . . . . . . .
. 1 . . . . 4 . . . . . . . . . . . .
. o . . . . . . . . . . . . . . . . .
. . . . . . . . 5 . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . 6 . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . 7 . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . 8 . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . 9 . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . .10 . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . .11 . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . .12 . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .13 .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
Is the number of consecutive 1's bounded? - Gordon Hamilton, Mar 31 2015
LINKS
James Rayman, Table of n, a(n) for n = 1..10000
James Rayman, Python program
EXAMPLE
a(1) = 1 because the turn (0,0) to (0,1) to (1,2) is clockwise.
a(2) = 1 because the turn (0,1) to (1,2) to (3,2) is clockwise.
a(3) = 1 because the turn (1,2) to (3,2) to (5,1) is clockwise.
a(4) = 1 because the turn (3,2) to (5,1) to (7,-1) is clockwise.
a(5) = 1 because the turn (5,1) to (7,-1) to (7,-4) is clockwise.
At a(6) there is a choice of which direction to go because the change of direction would be the same for both the following:
(7,-1) to (7,-4) to (6,-7) AND (7,-1) to (7,-4) to (8,-7).
In the case of a tie we look back to see the direction of the turn in the previous step and since a(5) = 1 we copy that. So it is the first option that we must choose: (7,-1) to (7,-4) to (6,-7).
a(7) = 1 because the turn (7,-4) to (6,-7) to (4,-10) is clockwise.
a(8) = -1 because the turn (6,-7) to (4,-10) to (4,-14) is counterclockwise.
PROG
(Python) See Rayman link.
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Gordon Hamilton, Mar 17 2015
EXTENSIONS
Corrected and extended by James Rayman, Jan 19 2021
STATUS
approved