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.

A363934 Table read by ascending antidiagonals. T(n,k) is the Sprague-Grundy value for the Heat Toggle game played on an n X k grid where each vertex has initial weight 1.

This page as a plain text file.
%I A363934 #14 Aug 05 2023 23:52:00
%S A363934 1,1,1,1,1,1,2,2,2,2,2,0,1,0,2,0,3,1,1,3,0,3,1,3,0,3,1,3,1,1,0,1,1,0,
%T A363934 1,1,1,0,2,0,2,0,2,0,1,2,3,0,0,0,0,0,0,3,2,2,3,1,1
%N A363934 Table read by ascending antidiagonals. T(n,k) is the Sprague-Grundy value for the Heat Toggle game played on an n X k grid where each vertex has initial weight 1.
%C A363934 Heat Toggle is an impartial two-player game played on a simple graph, where each vertex is assigned a weight of -1 or 1.
%C A363934 A Heat Toggle move consists of selecting a vertex of weight 1 and switching its weight to -1 as well as switching the weight of each of its neighbors, changing 1 to -1 and -1 to 1. We additionally only allow moves that strictly decrease the sum of all weights.
%C A363934 The first row T(1,k) coincides with octal game 0.1337, see A071427.
%C A363934 The second row T(2,k) coincides with the octal game 0.137 (Dawson's Chess), see A002187.
%D A363934 E. R. Berlekamp, J. H. Conway, and R. K. Guy, Winning Ways for Your Mathematical Plays, Vol. 1, CRC Press, 2001.
%H A363934 E. Fiorini, M. Lind, A. Woldar, and T. W. H. Wong, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL24/Wong/wong31.pdf">Characterizing Winning Positions in the Impartial Two-player Pebbling Game on Complete Graphs</a>, Journal of Integer Sequences 24(6), (2021).
%e A363934 The data is organized in a table beginning with row n = 1 and column k = 1. The data is read by ascending antidiagonals. T(2,3)=2.
%e A363934 The table T(n,k) begins:
%e A363934 [n/k]  1   2   3   4   5   6  ...
%e A363934 ---------------------------------
%e A363934 [1]    1,  1,  1,  2,  2,  0, ...
%e A363934 [2]    1,  1,  2,  0,  3,  1, ...
%e A363934 [3]    1,  2,  1,  1,  3,  0, ...
%e A363934 [4]    2,  0,  1,  0,  1,  0, ...
%e A363934 [5]    2,  3,  3,  1,  2,  0, ...
%e A363934 [6]    0,  1,  0,  0,  0,  ...
%o A363934 (Sage) SG_value_hash = {}
%o A363934 def MEX(S):
%o A363934     i = 0
%o A363934     while True:
%o A363934         if i not in S:
%o A363934             return i
%o A363934         i += 1
%o A363934 def SG_value(G):
%o A363934     global SG_value_hash
%o A363934     SG_value_hash = {}
%o A363934     ons = set(G.vertices())
%o A363934     offs = set()
%o A363934     return SG_value_helper(G, ons, offs)
%o A363934 def SG_value_helper(G, ons, offs):
%o A363934     ons_orig = ons.copy()
%o A363934     offs_orig = offs.copy()
%o A363934     child_SG_values = set()
%o A363934     for v in ons_orig:
%o A363934         vNeighborhood = set(G.neighbors(v))
%o A363934         neighNowOff = ons_orig.intersection(vNeighborhood)
%o A363934         neighNowOn = offs_orig.intersection(vNeighborhood)
%o A363934         if len(neighNowOff) >= len(neighNowOn):
%o A363934             ons.remove(v)
%o A363934             offs.add(v)
%o A363934             ons.update(neighNowOn)
%o A363934             offs -= neighNowOn
%o A363934             offs.update(neighNowOff)
%o A363934             ons -= neighNowOff
%o A363934             result = -1 # placeholder
%o A363934             encoded_position = str(offs)
%o A363934             if encoded_position in SG_value_hash:
%o A363934                 result = SG_value_hash[encoded_position]
%o A363934             else:
%o A363934                 result = SG_value_helper(G, ons, offs)
%o A363934             SG_value_hash[encoded_position] = result
%o A363934             ons.add(v)
%o A363934             offs.remove(v)
%o A363934             ons -= neighNowOn
%o A363934             offs.update(neighNowOn)
%o A363934             offs -= neighNowOff
%o A363934             ons.update(neighNowOff)
%o A363934             child_SG_values.add(result)
%o A363934     return MEX(child_SG_values)
%o A363934 for sum_of_both in range(2,11):
%o A363934     antidiagonal = []
%o A363934     for n in range(1, sum_of_both):
%o A363934         G = graphs.Grid2dGraph(n, sum_of_both-n)
%o A363934         antidiagonal.append(SG_value(G))
%o A363934     print(antidiagonal)
%Y A363934 Cf. A361517, A071427, A002187.
%K A363934 nonn,tabl,more
%O A363934 1,7
%A A363934 _Jean-Pierre Appel_, _Patrick G. Cesarz_, _Djeneba Diop_, _Eugene Fiorini_, _Nathan Hurtig_, _Andrew Woldar_, Jun 28 2023