Search: a261990 -id:a261990
|
|
A274369
|
|
Let the starting square of Langton's ant have coordinates (0, 0), with the ant looking in negative x-direction. a(n) is the x-coordinate of the ant after n moves.
|
|
+10
5
|
|
|
0, 0, 1, 1, 0, 0, -1, -1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 2, 2, 1, 1, 2, 2, 3, 3, 2, 2, 1, 1, 2, 2, 3, 3, 4, 4, 3, 3, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 1, 1, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, -1, -1, -2, -2, -1, -1, -2, -2, -3, -3, -2, -2, -1, -1, -2, -2, -3
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,21
|
|
LINKS
|
|
|
FORMULA
|
|
|
PROG
|
(Python)
def ant(n):
steps = [(1, 0), (0, 1), (-1, 0), (0, -1)]
black = set()
x = y = 0
position = [(x, y)]
direction = 2
for _ in range(n):
if (x, y) in black:
black.remove((x, y))
direction += 1
else:
black.add((x, y))
direction -= 1
(dx, dy) = steps[direction%4]
x += dx
y += dy
position.append((x, y))
return position
print([p[0] for p in ant(100)])
# change p[0] to p[1] to get y-coordinates
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|
|
A275305
|
|
Color of the cell Langton's Ant living on triangular tiling touches on its n-th step before the color is changed by the ant; 0=white, 1=black.
|
|
+10
5
|
|
|
0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0
|
|
COMMENTS
|
The ant starts from a completely white tiling.
There are never more than six 0's or 1's in a row because six identical turns will circle back into the same cell, which will have since changed.
|
|
LINKS
|
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|
|
A274370
|
|
Let the starting square of Langton's ant have coordinates (0, 0), with the ant looking in negative x-direction. a(n) is the y-coordinate of the ant after n moves.
|
|
+10
4
|
|
|
0, 1, 1, 0, 0, -1, -1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0, -1, -1, -2, -2, -3, -3, -2, -2, -1, -1, -2, -2, -1, -1, -2, -2, -1, -1, 0, 0, -1, -1, 0, 0, 1, 1, 0, 0, -1, -1, 0, 0, 1, 1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, 1, 1, 2, 2, 3, 3, 2, 2, 1, 1, 2, 2, 1, 1, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,12
|
|
LINKS
|
|
|
FORMULA
|
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|
|
A326695
|
|
Langton's ant with three cell colors: color of the cell the ant moves to at the end of iteration n: 0 for white, 1 for black, 2 for gray.
|
|
+10
2
|
|
|
0, 0, 0, 1, 0, 0, 0, 2, 1, 1, 1, 0, 1, 1, 1, 1, 2, 2, 0, 0, 2, 1, 1, 0, 2, 1, 2, 2, 0, 2, 1, 0, 0, 2, 1, 1, 2, 2, 0, 0, 0, 0, 1, 0, 0, 0, 2, 1, 1, 1, 0, 1, 1, 1, 1, 2, 2, 0, 2, 1, 0, 2, 1, 2, 2, 0, 0, 2, 1, 1, 0, 0, 2, 1, 1, 2, 2, 0, 2, 1, 0, 2, 1, 2, 2, 0, 0
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,8
|
|
COMMENTS
|
On a white square, turn 90 degrees right, change the color to black, then move forward one unit.
On a black square, turn 90 degrees left, change the color to gray, then move forward one unit.
On a gray square, turn 180 degrees, change the color to white, then move forward one unit.
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
See illustrations in Fröhlich, 2019.
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|
|
A275117
|
|
Direction where Langton's ant is looking after n moves: 1 if looking in starting direction, 2 if looking 90 degrees clockwise from starting direction, 3 if looking 90 degrees counterclockwise from starting direction, or 4 if looking in direction opposite to starting direction.
|
|
+10
0
|
|
|
1, 2, 4, 3, 1, 3, 1, 2, 4, 3, 4, 3, 1, 2, 4, 2, 1, 3, 4, 3, 4, 3, 1, 2, 4, 2, 4, 3, 1, 2, 1, 3, 4, 2, 4, 2, 4, 3, 1, 2, 1, 2, 4, 3, 1, 3, 4, 2, 1, 2, 1, 3, 1, 2, 1, 2, 4, 3, 1, 3, 4, 2, 1, 2, 1, 2, 4, 3, 1, 3, 1, 2, 4, 3, 4, 2, 1, 3, 1, 3, 1, 2, 4, 3, 4, 3, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
LINKS
|
|
|
FORMULA
|
Let d(n) = (A255938(n) mod 4). Then:
a(n)=1 if d(n)=0,
a(n)=2 if d(n)=1,
a(n)=4 if d(n)=2,
a(n)=3 if d(n)=3.
(End)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
Search completed in 0.006 seconds
|