OFFSET
0,19
COMMENTS
The ant starts on a completely white grid.
Order of operations: turn 90 degrees, change cell color, move forward one unit.
The rules governing the movement of the ant and the change of cell colors are shown in the following table:
Cell color at | Direction of | Color the cell is
start of iteration | 90-degree turn | changed to
--------------------------------------------------------
white | right | black
black | left | blue
blue | up | yellow
yellow | down | white
LINKS
Jinyuan Wang, Table of n, a(n) for n = 0..10000
Felix Fröhlich, Illustration of iterations 0-50 of the ant.
Wikipedia, Langton's ant.
Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-1).
FORMULA
a(n) = a(n-28) + 2 for n >= 93504. - Jinyuan Wang, Jul 13 2025
Recurrence: a(n) = 2*a(n-1) - 2*a(n-2) + 2*a(n-3) - 2*a(n-4) + ... + 2*a(n-27) - a(n-28) for n >= 93504. - Jianing Song, Jul 31 2026
EXAMPLE
See illustration in links.
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Felix Fröhlich, May 28 2019
EXTENSIONS
a(51)-a(80) from Charlie Neder, Jun 06 2019
STATUS
approved