login
Lexicographically earliest sequence of nonnegative terms forming a clockwise square spiral when nothing else is read except the nonprime/prime nature of the terms (see the Comments section).
1

%I #6 Jun 05 2021 17:03:27

%S 0,2,3,1,5,4,7,6,8,11,9,10,13,12,14,15,17,16,18,20,19,21,22,24,25,23,

%T 26,27,28,30,29,32,33,34,35,36,31,38,39,40,42,44,37,45,46,48,49,50,51,

%U 41,52,54,55,56,57,58,43,60,62,63,64,65,66,68,47,69,70,72,74,75,76,77,53,78,80,81,82,84,85,86

%N Lexicographically earliest sequence of nonnegative terms forming a clockwise square spiral when nothing else is read except the nonprime/prime nature of the terms (see the Comments section).

%C A nonprime term turns the pencil 0 degrees to the right, then advances 1 unit; a prime term turns the pencil 90 degrees to the right, then advances 1 unit.

%e 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.

%Y Cf. A345012 (same idea with nonprime/prime digits), A344547 (same idea with even/odd terms), A174344 (an example of a clockwise square spiral).

%K base,nonn

%O 1,2

%A _Eric Angelini_ and _Carole Dubois_, Jun 05 2021