login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 


A345012
Lexicographically earliest sequence of nonnegative terms forming a clockwise square spiral when nothing else is read except the nonprime/prime nature of the digits (see the Comments section).
1
0, 2, 3, 1, 5, 4, 7, 6, 8, 20, 9, 21, 10, 24, 11, 26, 14, 12, 16, 18, 28, 19, 40, 29, 41, 44, 30, 46, 48, 13, 49, 60, 61, 31, 64, 66, 68, 34, 69, 80, 81, 36, 84, 86, 88, 15, 89, 90, 91, 94, 38, 96, 98, 99, 102, 100, 101, 104, 39, 106, 108, 109, 50, 110, 111, 114, 51, 116, 118, 119, 17, 140, 141, 144, 103
OFFSET
1,2
COMMENTS
A nonprime digit turns the pencil 0 degrees to the right, then advances 1 unit; a prime digit 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 2 is prime, the pencil turns 90 degrees towards the South and a 1-unit line is traced. As 3 is prime, the pencil turns 90 degrees towards the West and a 1-unit line is traced. As 1 is nonprime, the pencil doesn't change its orientation (towards the West) and a 1-unit line is traced. As 5 is prime, the pencil turns 90 degrees towards the North and a 1-unit line is traced. As 4 is nonprime, the pencil doesn't change its orientation (towards the North) and a 1-unit line is traced. Etc.
When it comes to a(10) = 20, the pencil reads 2 (prime), turns to the right and advances 1 square, then reads 0 (nonprime), doesn't change its orientation and advances 1 square again. Etc.
CROSSREFS
Cf. A345011 (same idea with nonprime/prime terms), A344548 (same idea with even/odd digits), A174344 (an example of a clockwise square spiral).
Sequence in context: A319068 A335423 A345011 * A345145 A114690 A336364
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Jun 05 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 22 06:15 EDT 2024. Contains 376097 sequences. (Running on oeis4.)