login
Van Eck sequence on a square spiral on a 2-D grid.
2

%I #27 Aug 03 2024 17:57:22

%S 0,0,1,0,1,2,0,2,2,1,3,0,2,4,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,

%T 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,

%U 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

%N Van Eck sequence on a square spiral on a 2-D grid.

%C Fill a 2-dimensional board made from square cells with numbers using the following rules:

%C - start from 0;

%C - if the number just written is new then the next number is 0;

%C - if the number just written was present on the board before, the next number is the distance from its closest occurrence, counting cells you need to pass through to reach it

%C .

%C 1 0---->2---->2---->1

%C ^ ^ |

%C | | |

%C | | v

%C 1 2 0---->0 3

%C ^ ^ Start | |

%C | | | |

%C | | v v

%C 1 1<----0<----1 0

%C ^ |

%C | |

%C | v

%C 1<----1<----0<----4<----2

%C .

%C a(n) = 1 for all n >= 17 because the previous 1 will always be adjacent to another 1. The version of this sequence using the Moore neighborhood (vertex adjacency) consists of 0, 0, 1, 0, 1, 2, 0, 1, 2, 2, and then an infinite number of 1's. - _Charlie Neder_, Jun 11 2019

%H <a href="/index/Rec#order_01">Index entries for linear recurrences with constant coefficients</a>, signature (1).

%F G.f.: x^3*(1 - x + x^2 + x^3 - 2*x^4 + 2*x^5 - x^7 + 2*x^8 - 3*x^9 + 2*x^10 + 2*x^11 - 4*x^12 + x^13)/(1 - x). - _Elmo R. Oliveira_, Aug 03 2024

%Y Cf. A181391, A308625.

%K nonn,easy

%O 1,6

%A _Jacek Sandomierz_, Jun 11 2019