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-3 of 3 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

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

A293539 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).

Original entry on oeis.org

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, 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, -3, -2, 0, -2, -3, -5, -5, -4, 0, 1, 1, -5, -5, -4, -4, -5, -6, -6
Offset: 1

Views

Author

Rémy Sigrist, Oct 11 2017

Keywords

Comments

See A293540 for the Y-coordinate of P(n).
The following diagram depicts the angle t cited in the name:
. P(n)* .
. | t .
. | .
. | .
. |.
. P(n-1)*
. /
. /
. P(n-2)*
The sequence P has similarities with Langton's ant:
- after an apparently chaotic initial phase, an escape consisting of a repetitive pattern emerges at n = 9118 (see illustrations in Links section),
- more formally: P(n+258) = P(n) + (14,-8) for any n >= 9118,
- See A274369 and A274370 for the coordinates of Langton's ant,
- See also A293207 for other sequences of points with emerging escapes.
See also A292469 for a sequence of points with similar construction features.

Examples

			See representation of first points in Links section.
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(n + 258) = a(n) + 14 for any n >= 9118.
Showing 1-3 of 3 results.