login
A331348
Fill an infinite square array by following a spiral around the origin; if the square at position (x, y) is empty then set either T(x, y) = 1 or T(x, y) = T(2*x, 2*y) = 2 such that the RUNS transform of the sequence of values as they are chosen equals the sequence of values as they are visited; first choose the value 1. This sequence corresponds to the values as they are visited.
2
1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 2, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1
OFFSET
0,2
COMMENTS
The sequence {a(n)} gives the values as they are visited, while, say {b(n)}, gives the values as they are chosen; so:
- a "2" will account for two terms in {a(n)} and for one term in {b(n)},
- a "1" will account for one term in both sequences,
- {a(n)} = RUNS({b(n)}).
EXAMPLE
The central portion of the spiral is:
1---2---1---1---2---1---1
| |
1 2---1---1---2---2 2
| | | |
2 1 1---1---2 2 1
| | | | | |
2 2 2 1---2 2 2
| | | | |
1 1 1---2---2---1 2
| | |
1 2---2---2---1---2---1
|
2---1---1---2---1---1---2 ...
PROG
(PARI) \\ See Links section.
CROSSREFS
See A331349 for the sequence of values as they are chosen.
See A331034 for a similar sequence.
Sequence in context: A078880 A000002 A074295 * A236479 A116514 A334028
KEYWORD
nonn,tabl
AUTHOR
Rémy Sigrist, Jan 14 2020
STATUS
approved