[seqfan] Re: To walk on a grid

Allan Wechsler acwacw at gmail.com
Mon Aug 31 18:03:13 CEST 2015


I am having trouble following the explanation. Do the arrows belong to the
individual squares, or do I carry the arrow with me? At first, I thought
that each square has its own arrow, which is left behind in its home square
when I walk away. But if that were true, then 1111 would not take me home,
because each new square I encounter would have an arrow pointing North,
which had never been altered.

I think, from the rest of your explanation, that there is really only one
arrow, showing the current direction I am facing. That is consistent with
the rest of the data you give. Is this interpretation correct?

On Mon, Aug 31, 2015 at 11:10 AM, Eric Angelini <Eric.Angelini at kntv.be>
wrote:

>
> Hello SeqFans,
> Let's imagine an infinite grid of side-1 squares covering the plane.
> On the floor of each square there is an arrow pointing to the North.
> If I drop an integer N (say 27) on one of the squares, this is what
> will happen :
> (1) I will read the leftmost unread digit « d » of N (here, 2) and
>     turn the arrow to the right if « d » is even (this is the case
>     here with 2), else to the left (if « d » is odd);
> (2) I will move « d » squares in the new direction (here, 2 squares
>     to the East);
> (3) I will go back to instruction (1) as long as there are unread
>     digits in N.
>
> Question:
> For what N's does one go back to the starting square?
>
> The integer 1111 is such an N, of course.
> As are 2222, 3333, etc.
> As is 1213311
>    or 1215331
>    or 1217351
>    or 1219371.
> As is 202 - but this is tricky! -- Explanation for N = 202:
> 1) Turn the arrow of the origin square to the right (East) - as
>    the leftmost « 2 » is even;
> 2) Walk 2 squares in this direction;
> 3) Turn the arrow of the square to the right (South) - as « 0 »
>    is even;
> 4) Walk 0 square in this direction;
> 5) Turn the arrow of the (same!) square to the right (West) - as
>    the rightmost « 2 » is even;
> 6) Walk 2 squares in this direction: you're back on the origin
>    square.
>
> Best,
> É.
>
>
>
>
>
>
>
>
>
> _______________________________________________
>
> Seqfan Mailing list - http://list.seqfan.eu/
>



More information about the SeqFan mailing list