cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-6 of 6 results.

A102358 Finite sequence of iterations at which Langton's Ant passes through the origin.

Original entry on oeis.org

0, 4, 8, 16, 52, 60, 96, 140, 184, 276, 368, 376, 384, 392, 428, 436, 472, 656, 660, 3412, 4144, 4152, 6168, 6764, 8048, 8052, 8056, 8060, 8068
Offset: 1

Views

Author

Robert H Barbour, Feb 21 2005, corrected Feb 27 2005

Keywords

Comments

Ant Farm algorithm available from bbarbour(AT)unitec.ac.nz.
Numbers n such that A274369(n) = A274370(n) = 0. - Felix Fröhlich, Jul 26 2016

References

  • Christopher G. Langton et al., (1990) Artificial Life II. Addison-Wesley, Reading, MA., USA

Crossrefs

A102127 Interval between successive arrivals at the origin of an LQTL CA.

Original entry on oeis.org

4, 4, 4, 16, 4, 4, 4, 16, 4, 4, 4, 4, 4, 40, 4, 16, 4, 4, 4, 4, 12, 4, 4, 8, 4, 40, 4, 4, 4, 4, 4, 88, 4, 40, 4, 4, 4, 4, 4, 16, 4, 4, 4, 16, 4, 4, 4, 4, 4, 40, 4, 88, 4, 4, 4, 4, 4, 40, 4, 8, 4, 12, 4, 4, 4, 4, 4, 16, 4, 40, 4, 4, 4, 4, 4, 16, 4, 4, 4, 16, 4
Offset: 0

Views

Author

Robert H Barbour, Feb 14 2005

Keywords

Comments

The "LQTL CA" is similar to the Langton's ant but has 4 states. The ant turns right from the cells with states 0, 1 and left from the cells with states 2, 3 and changes the state of the cell according to the rules 0 -> 1 -> 2 -> 3 -> 0. - Andrey Zabolotskiy, Jan 06 2023

Crossrefs

First differences of A102110.

Programs

  • Python
    x = y = direction = 0
    cells, a = {}, []
    for n in range(1, 1000):
        c = cells.get((x, y), 0)
        cells[(x, y)] = (c + 1) % 4
        direction += [1, 1, -1, -1][c]
        (dx, dy) = [(1, 0), (0, 1), (-1, 0), (0, -1)][direction%4]
        x += dx;  y += dy
        if (x, y) == (0, 0):
            a.append(n)
    print(a) # A102110
    print([x-y for x, y in zip(a, [0]+a)]) # this sequence -  Andrey Zabolotskiy, Jan 06 2023

Extensions

Terms a(26) and beyond from Andrey Zabolotskiy, Jan 06 2023

A126978 a(n) = 104*n + 9977.

Original entry on oeis.org

9977, 10081, 10185, 10289, 10393, 10497, 10601, 10705, 10809, 10913, 11017, 11121, 11225, 11329, 11433, 11537, 11641, 11745, 11849, 11953, 12057, 12161, 12265, 12369, 12473, 12577, 12681, 12785, 12889, 12993, 13097, 13201, 13305, 13409, 13513, 13617, 13721, 13825
Offset: 0

Views

Author

Robert H Barbour, Mar 20 2007, Jun 12 2007

Keywords

Comments

Langton's Ant Superhighway, the start point (9977th iteration, J. Propp) and the period length for the Superhighway (104).

Crossrefs

Programs

Formula

a(0)=9977, a(1)=10081, a(n) = 2*a(n-1) - a(n-2). - Harvey P. Dale, Dec 16 2011
G.f.: (9977 - 9873*x)/(1-x)^2. - Vincenzo Librandi, Sep 10 2015
E.g.f.: exp(x)*(9977 + 104*x). - Elmo R. Oliveira, Dec 08 2024

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.

Original entry on oeis.org

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
Offset: 0

Views

Author

Felix Fröhlich, Jun 19 2016

Keywords

Crossrefs

Cf. A274370 (y-coordinate).

Programs

  • Python
    # A274369: Langton's ant by Andrey Zabolotskiy, Jul 05 2016
    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

Formula

a(n+104) = a(n) + 2 for n > 9975. - Andrey Zabolotskiy, Jul 05 2016

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.

Original entry on oeis.org

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
Offset: 0

Views

Author

Felix Fröhlich, Jun 19 2016

Keywords

Crossrefs

Cf. A274369 (x-coordinate).

Formula

a(n+104) = a(n) - 2 for n > 9975. - Andrey Zabolotskiy, Jul 05 2016

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.

Original entry on oeis.org

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
Offset: 0

Views

Author

Felix Fröhlich, Jul 18 2016

Keywords

Crossrefs

Formula

From Andrey Zabolotskiy, Oct 11 2016: (Start)
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)

Extensions

More terms from Andrey Zabolotskiy, Oct 11 2016
Showing 1-6 of 6 results.