OFFSET
0,2
COMMENTS
The starting square is always considered part of the walk.
LINKS
Math StackExchange, Relatively efficient program to compute a(n) for larger n.
EXAMPLE
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.
PROG
(Python3)
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
CROSSREFS
KEYWORD
nonn,frac,walk
AUTHOR
Orson R. L. Peters, Aug 08 2019
STATUS
approved