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.

A375298 Length of the longest winning path in n X n Hex.

This page as a plain text file.
%I A375298 #14 Aug 19 2024 11:44:13
%S A375298 1,2,5,8,11,16,23,30,37,47,57,69,81,94,109,124,140,157,175,195,215,
%T A375298 236,259,282,306,331,357,385,413,442,473,504,536,569,603,639,675,712,
%U A375298 751,790,830,871,913,957,1001,1046,1093,1140,1188,1237,1287,1339,1391,1444,1499,1554,1610,1667,1725,1785
%N A375298 Length of the longest winning path in n X n Hex.
%C A375298 A winning path is a set of cells connecting the top edge to the bottom edge, minimal with respect to inclusion.
%H A375298 Peter Selinger, <a href="/A375298/b375298.txt">Table of n, a(n) for n = 1..10000</a>
%H A375298 Peter Selinger, <a href="https://arxiv.org/abs/2408.05601">Longest winning paths in Hex</a>, arXiv:2408.05601 [math.CO], 2024.
%F A375298 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.
%e A375298 The longest winning path for 10 X 10 Hex has length 47.
%e A375298 ====================
%e A375298  X . . . . . . . . .
%e A375298   X X X X X X X X X X
%e A375298    . . . . . . . . . X
%e A375298     . X X X . X X X . X
%e A375298      X . . X X . . X . X
%e A375298       X X . . . X X . X .
%e A375298        . X . X X . . . X X
%e A375298         X . X . . X X . . X
%e A375298          X . X X X . X X X .
%e A375298           X . . . . . . . . .
%e A375298           ====================
%o A375298 (Python)
%o A375298 def a(n):
%o A375298   if n == 1:
%o A375298     return 1
%o A375298   elif n == 2:
%o A375298     return 2
%o A375298   elif n == 3:
%o A375298     return 5
%o A375298   elif n == 4:
%o A375298     return 8
%o A375298   elif n == 9:
%o A375298     return 37
%o A375298   elif n % 8 == 3:
%o A375298     return (2*n**2 - n + 1) // 4 - 1
%o A375298   else:
%o A375298     return (2*n**2 - n + 1) // 4
%Y A375298 Number of solutions is A375299.
%Y A375298 Cf. A357234.
%K A375298 easy,nonn
%O A375298 1,2
%A A375298 _Peter Selinger_, Aug 12 2024