

A344367


Squares visited on a spirally numbered board when stepping to the closest unvisited square that contains a number that shares one or more digits with the number of the current square. If two or more such squares are the same distance away the one with the smaller number is chosen.


2



1, 11, 10, 12, 13, 14, 15, 16, 17, 18, 19, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 3, 23, 22, 21, 20, 40, 41, 42, 43, 44, 45, 46, 47, 24, 25, 26, 27, 28, 29, 2, 52, 51, 50, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 59, 58, 57, 56, 55, 54, 53, 125, 124, 123, 122, 121, 120
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


LINKS

Table of n, a(n) for n=1..72.
Scott R. Shannon, Image of the first 1000 steps.. The colors are graduated across the spectrum to show the relative step order. The lowest unvisited square, 4, is marked with a yellow dot.
Scott R. Shannon, Image of the first 200000 steps.


EXAMPLE

The board is numbered with the square spiral:
.
1716151413 .
  .
18 543 12 29
    
19 6 12 11 28
   
20 78910 27
 
212223242526
.
a(2) = 11. There are three squares 2 units away from the starting square 1 that also contain the digit 1  11, 15, and 19. Of these 11 is the smallest so is the square stepped to.
a(3) = 10. Of the two adjacent squares to 11 that also contain the digit 1 the square 10 is the smallest.
a(4) = 12. This is the only unvisited square within 2 units of a(3) = 10 that also contains the digit 1.
a(12) = 39. This is the only unvisited square within sqrt(2) units of a(11) = 19 that contains either the digit 3 or 9. It is also the first square stepped to that does not share the digit 1 with the previous square.


CROSSREFS

Cf. A343530, A296030, A174344, A274923, A067581, A330979, A332767.
Sequence in context: A217789 A347765 A004283 * A106421 A019329 A086919
Adjacent sequences: A344364 A344365 A344366 * A344368 A344369 A344370


KEYWORD

nonn,base


AUTHOR

Scott R. Shannon and Eric Angelini, May 16 2021


STATUS

approved



