%I #20 Oct 13 2017 03:22:22
%S 0,1,1,0,-1,-1,0,2,2,1,0,-1,-2,-2,-1,1,3,3,2,2,3,3,2,1,-1,-2,-2,0,1,4,
%T 4,3,2,1,0,-3,-3,-2,-1,2,5,5,4,4,5,5,4,3,2,1,0,-3,-4,-4,-3,-3,-4,-4,
%U -3,-2,0,-2,-3,-5,-5,-4,0,1,1,-5,-5,-4,-4,-5,-6,-6
%N Let P be the sequence of distinct lattice points defined by the following rules: P(1) = (0,0), P(2) = (1,0), and for any n > 2, P(n) is the closest lattice point to P(n-1) such that the angle of the vectors (P(n-2), P(n-1)) and (P(n-1), P(n)), say t, satisfies 0 < t <= Pi/2, and in case of a tie, minimize the angle t; a(n) = X-coordinate of P(n).
%C See A293540 for the Y-coordinate of P(n).
%C The following diagram depicts the angle t cited in the name:
%C . P(n)* .
%C . | t .
%C . | .
%C . | .
%C . |.
%C . P(n-1)*
%C . /
%C . /
%C . P(n-2)*
%C The sequence P has similarities with Langton's ant:
%C - after an apparently chaotic initial phase, an escape consisting of a repetitive pattern emerges at n = 9118 (see illustrations in Links section),
%C - more formally: P(n+258) = P(n) + (14,-8) for any n >= 9118,
%C - See A274369 and A274370 for the coordinates of Langton's ant,
%C - See also A293207 for other sequences of points with emerging escapes.
%C See also A292469 for a sequence of points with similar construction features.
%H Rémy Sigrist, <a href="/A293539/b293539.txt">Table of n, a(n) for n = 1..12000</a>
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Langton%27s_ant">Langton's ant</a>
%H Rémy Sigrist, <a href="/A293539/a293539.png">Representation of P(n) for n=1..42, with lines joining consecutive points</a>
%H Rémy Sigrist, <a href="/A293539/a293539_3.png">Representation of P(n) for n=1..500, with lines joining consecutive points</a>
%H Rémy Sigrist, <a href="/A293539/a293539_1.png">Representation of the repetitive pattern emerging at n=9118</a>
%H Rémy Sigrist, <a href="/A293539/a293539_2.png">Colorized representation of the points P(n) for n=1..12000</a>
%H Rémy Sigrist, <a href="/A293539/a293539_4.png">Colorized representation of the points P'(n) of the variant where we maximize the angle t in case of a tie for n=1..1000000</a>
%H Rémy Sigrist, <a href="/A293539/a293539.gp.txt">PARI program for A293539</a>
%F a(n + 258) = a(n) + 14 for any n >= 9118.
%e See representation of first points in Links section.
%o (PARI) See Links section.
%Y Cf. A274369, A274370, A292469, A293207, A293540.
%K sign,look
%O 1,8
%A _Rémy Sigrist_, Oct 11 2017