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-2 of 2 results.

A326954 Numerator of the expected number of distinct squares visited by a knight's random walk on an infinite chessboard after n steps.

Original entry on oeis.org

1, 2, 23, 15, 2355, 1395, 102971, 58331, 16664147, 9197779, 160882675, 87300443, 48181451689, 25832538281, 881993826001, 468673213505, 508090131646771, 268129446332211, 4514206380211785, 2369170809554097, 317528931045821675
Offset: 0

Views

Author

Orson R. L. Peters, Aug 08 2019

Keywords

Comments

The starting square is always considered part of the walk.

Examples

			a(0) = 1 (from 1/1), we count the starting square.
a(1) = 2 (from 2/1), each possible first step is unique.
a(2) = 23 (from 23/8), as for each possible first step 1/8th of the second steps go back to a previous square, thus the expected distinct squares visited is 2 + 7/8 = 23/8.
		

Crossrefs

See A326955 for denominators. Cf. A309221.

Programs

  • Python
    from itertools import product
    from fractions import Fraction
    def walk(steps):
        s = [(0, 0)]
        for dx, dy in steps:
            s.append((s[-1][0] + dx, s[-1][1] + dy))
        return s
    moves = [(1, 2), (1, -2), (-1, 2), (-1, -2),
             (2, 1), (2, -1), (-2, 1), (-2, -1)]
    A326954 = lambda n: Fraction(
            sum(len(set(walk(steps)))
                for steps in product(moves, repeat=n)),
            8**n
        ).numerator

A309221 Expected number of distinct squares visited by a knight's random walk on an infinite chessboard after n steps, normalized to give an integer.

Original entry on oeis.org

1, 2, 23, 240, 2355, 22320, 205942, 1866592, 16664147, 147164464, 1287061400, 11174456704, 96362903378, 826641224992, 7055950608008, 59990171328640, 508090131646771, 4290071141315376, 36113651041694280, 303253863622924416, 2540231448366573400
Offset: 0

Views

Author

N. J. A. Sloane, Aug 28 2019

Keywords

Comments

Based on A326954/A326955.
a(0)=1; for n>0, a(n) = (A326954(n)/A326955(n))*2^(3*n-3). (It is only a conjecture that this is always an integer).

Crossrefs

Showing 1-2 of 2 results.