OFFSET
1,2
COMMENTS
A winning path is a set of cells connecting the top edge to the bottom edge, minimal with respect to inclusion.
LINKS
Peter Selinger, Table of n, a(n) for n = 1..10000
Peter Selinger, Longest winning paths in Hex, arXiv:2408.05601 [math.CO], 2024.
FORMULA
Provably for n >= 10: a(n) = n^2/2 - n/4 - 3/4 if n ≡ 3 (mod 8), and a(n) = floor(n^2/2 - n/4 + 1/4) otherwise.
EXAMPLE
The longest winning path for 10 X 10 Hex has length 47.
====================
X . . . . . . . . .
X X X X X X X X X X
. . . . . . . . . X
. X X X . X X X . X
X . . X X . . X . X
X X . . . X X . X .
. X . X X . . . X X
X . X . . X X . . X
X . X X X . X X X .
X . . . . . . . . .
====================
PROG
(Python)
def a(n):
if n == 1:
return 1
elif n == 2:
return 2
elif n == 3:
return 5
elif n == 4:
return 8
elif n == 9:
return 37
elif n % 8 == 3:
return (2*n**2 - n + 1) // 4 - 1
else:
return (2*n**2 - n + 1) // 4
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Peter Selinger, Aug 12 2024
STATUS
approved