login
A344547
Lexicographically earliest sequence of nonnegative terms forming a clockwise square spiral when nothing else is read except the parity of the terms (see the Comments section).
4
0, 1, 3, 2, 5, 4, 7, 6, 8, 9, 10, 12, 11, 14, 16, 18, 13, 20, 22, 24, 15, 26, 28, 30, 32, 17, 34, 36, 38, 40, 19, 42, 44, 46, 48, 50, 21, 52, 54, 56, 58, 60, 23, 62, 64, 66, 68, 70, 72, 25, 74, 76, 78, 80, 82, 84, 27, 86, 88, 90, 92, 94, 96, 98, 29, 100, 102, 104, 106, 108, 110, 112, 31, 114
OFFSET
1,3
COMMENTS
An even term turns the pencil 0 degrees to the right, then advances 1 unit; an odd term turns the pencil 90 degrees to the right, then advances 1 unit.
EXAMPLE
The pencil points towards the East before the start. The 0 doesn't change its orientation and a 1-unit line directed towards the East is traced. As 1 is odd, the pencil turns 90 degrees towards the South and a 1-unit line is traced. As 3 is odd, the pencil turns 90 degrees towards the West and a 1-unit line is traced. As 2 is even, the pencil doesn't change its orientation (towards the West) and a 1-unit line is traced. As 5 is odd, the pencil turns 90 degrees towards the North and a 1-unit line is traced. As 4 is even, the pencil doesn't change its orientation (towards the North) and a 1-unit line is traced. Etc.
CROSSREFS
Cf. A344548 (same idea with digits), A174344 (an example of a clockwise square spiral).
Sequence in context: A297208 A372358 A301941 * A135762 A344548 A341903
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Jun 04 2021
STATUS
approved