This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A345012 #6 Jun 05 2021 17:03:39 %S A345012 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, %T A345012 30,46,48,13,49,60,61,31,64,66,68,34,69,80,81,36,84,86,88,15,89,90,91, %U A345012 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 %N 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). %C A345012 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. %e A345012 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. %e A345012 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. %Y A345012 Cf. A345011 (same idea with nonprime/prime terms), A344548 (same idea with even/odd digits), A174344 (an example of a clockwise square spiral). %K A345012 base,nonn %O A345012 1,2 %A A345012 _Eric Angelini_ and _Carole Dubois_, Jun 05 2021