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.

User: Patrick G. Cesarz

Patrick G. Cesarz's wiki page.

Patrick G. Cesarz has authored 8 sequences.

A374810 Values k such that the two-player impartial {0,1}-Toggle game on a path P(k+2) = v(1)v(2)...v(k+2) with a (1^k,0,1)-weight assignment is a second-player winning game.

Original entry on oeis.org

1, 6, 7, 12, 13, 18, 23, 24, 38, 39, 44, 45, 50, 51, 56, 62, 77, 115, 121, 153, 312, 333, 350, 427, 553, 554, 579
Offset: 1

Keywords

Comments

The two-player impartial {0,1}-Toggle game is played on a simple connected graph G where each vertex is assigned an initial weight of 0 or 1.
A Toggle move consists of selecting a vertex v and switching its weight as well as the weight of each of its neighbors. This move is legal only provided the weight of vertex v is 1 and the total sum of the vertex weights decreases.
In the special case G = P(k+2), a (1^k, 0, 1)-weight assignment is one in which vertex v(k+1) is assigned weight 0 and all remaining vertices are assigned weight 1.

Examples

			For n = 6, the {0,1}-Toggle game on P(8) with a (1,1,1,1,1,1,0,1)-weight assignment is a second-player winning game.
For n = 12, the {0,1}-Toggle game on P(14) with a (1,1,1,1,1,1,1,1,1,1,1,1,0,1)-weight assignment is a second-player winning game.
		

References

  • E. R. Berlekamp, J. H. Conway, and R. K. Guy, Winning Ways for Your Mathematical Plays, Vol. 1, CRC Press, 2001.

Programs

  • Python
    # See Cohen link.

A374910 Values k such that the two-player impartial {0,1}-Toggle game on a path P(k+4) = v(1)v(2)...v(k+4) with a (1^k,0,1,0,1)-weight assignment is a second-player winning game.

Original entry on oeis.org

1, 25, 26, 31, 32, 37, 38, 63, 64, 69, 70, 76, 101, 102, 139, 145, 177, 189, 215, 235, 252, 253, 267, 284, 290, 305, 311, 328, 360, 668
Offset: 1

Keywords

Comments

The two-player impartial {0,1}-Toggle game is played on a simple connected graph G where each vertex is assigned an initial weight of 0 or 1.
A Toggle move consists of selecting a vertex v and switching its weight as well as the weight of each of its neighbors. This move is only legal provided the weight of vertex v is 1 and the total sum of the vertex weights decreases.
In the special case G=P(k+4), a (1^k,0,1,0,1)-weight assignment is one in which vertices v(k+1) and v(k+3) are assigned weight 0 and all remaining vertices are assigned weight 1.
The path P(k+4m) where vertices v(k+1), v(k+3), ..., v(k+4m-1) are assigned weight 0 and all remaining vertices are assigned weight 1 will have the same Grundy numbers as G.

References

  • E. R. Berlekamp, J. H. Conway, and R. K. Guy, Winning Ways for Your Mathematical Plays, Vol. 1, CRC Press, 2001.

Programs

  • Python
    # See Cohen link.

A374920 Values k such that the two-player impartial {0,1}-Toggle game on a path P(k+6) = v(1)v(2)...v(k+6) with a (1^k,0,1,0,1,0,1)-weight assignment is a second-player winning game.

Original entry on oeis.org

1, 6, 7, 12, 13, 18, 23, 24, 39, 44, 45, 50, 51, 57, 62, 77, 115, 281, 319, 350, 389
Offset: 1

Keywords

Comments

The two-player impartial {0,1}-Toggle game is played on a simple connected graph G where each vertex is assigned an initial weight of 0 or 1.
A Toggle move consists of selecting a vertex v and switching its weight as well as the weight of each of its neighbors. This move is only legal provided the weight of vertex v is 1 and the total sum of the vertex weights decreases.
In the special case G=P(k+6), a (1^k,0,1,0,1,0,1)-weight assignment is one in which vertices v(k+1), v(k+3), and v(k+5) are assigned weight 0 and all remaining vertices are assigned weight 1.
The path P(k+4m+2) where vertices v(k+1), v(k+3), ..., v(k+4m+1) are assigned weight 0 and all remaining vertices are assigned weight 1 will have the same Grundy numbers as G.

References

  • E. R. Berlekamp, J. H. Conway, and R. K. Guy, Winning Ways for Your Mathematical Plays, Vol. 1, CRC Press, 2001.

Programs

  • Python
    # See Cohen link.

A363894 Number of weakly connected components of a halved addsub configuration graph with respect to integers mod n over a path with two vertices.

Original entry on oeis.org

1, 2, 1, 8, 2, 3, 1, 5, 8, 4, 2, 18, 3, 33, 1, 19, 5, 6, 8, 20, 4, 7, 2, 39, 18, 14, 3, 32, 33, 25, 1, 29, 19, 58, 5, 42, 6, 75, 8, 91, 20, 34, 4, 108, 7, 13, 2, 17, 39, 164, 18, 58, 14, 83, 3, 47, 32, 16, 33, 66, 25, 167, 1, 365, 29, 18, 19, 56, 58, 19, 5
Offset: 2

Keywords

Comments

The addsub game is played on a path with two vertices {u,v}. We define a configuration of the integers mod n on {u,v} by assigning weights wt(u) and wt(v).
An addsub move from u to v is a reassignment of weights given by wt(u) -> wt(u) - wt(v) (mod n) and wt(v) -> wt(u) + wt(v) (mod n). An addsub move from v to u (i.e. the backward move) is defined analogously.
The halved addsub configuration graph is the directed subgraph of the addsub configuration graph restricted to the forward move only: wt(u) -> wt(u) - wt(v) (mod n) and wt(v) -> wt(u) + wt(v) (mod n).

References

  • E. R. Berlekamp, J. H. Conway, and R. K. Guy, Winning Ways for Your Mathematical Plays, Vol. 1, CRC Press, 2001.

Crossrefs

Programs

  • Mathematica
    Upto=25;
    Table[
      VertexSet:={};
      EdgeSet:={};
      (* Compute configuration graph for integers mod n *)
      Do[
        Do[AppendTo[VertexSet,{i,j}];
          AppendTo[EdgeSet,{i,j}\[DirectedEdge]{Mod[i-j,n],Mod[i+j,n]}],
          {j,0,n-1}],
        {i,0,n-1}];
      (* Print n-th term *)
      Length[WeaklyConnectedComponents[Graph[VertexSet,EdgeSet]]],
      {n,2,Upto}]

A363893 Number of weakly connected components of an addsub configuration graph with respect to integers mod n over a path with two vertices.

Original entry on oeis.org

1, 2, 1, 4, 2, 3, 1, 5, 4, 4, 2, 6, 3, 11, 1, 11, 5, 6, 4, 12, 4, 7, 2, 13, 6, 14, 3, 10, 11, 25, 1, 29, 11, 18, 5, 12, 6, 21, 4, 25, 12, 34, 4, 32, 7, 13, 2, 17, 13, 48, 6, 16, 14, 25, 3, 47, 10, 16, 11, 18, 25, 87, 1, 95, 29, 18, 11, 32, 18, 19, 5
Offset: 2

Keywords

Comments

The addsub game is played on a path with two vertices {u,v}. We define a configuration of the integers mod n on {u,v} by assigning weights wt(u) and wt(v).
An addsub move from u to v is a reassignment of weights given by wt(u) -> wt(u) - wt(v) (mod n) and wt(v) -> wt(u) + wt(v) (mod n). An addsub move from v to u is defined analogously.
The addsub configuration graph with respect to the integers mod n over {u,v} is the directed graph in which each node corresponds to a configuration (wt(u),wt(v)) and a directed edge from a configuration to the resulting configuration is attainable via a single addsub move.

Examples

			For n=3, the (u,v) sequence of addsub moves forms the directed cycle (0,1)->(2,1)->(1,0)->(1,1)->(0,2)->(1,2)->(2,0)->(2,2)->(0,1). The (v,u) sequence of addsub moves forms the directed cycle (0,1)->(1,1)->(2,0)->(2,1)->(0,2)->(2,2)->(1,0)->(1,2)->(0,1). These two directed cycles form one weakly connected component. The isolated vertex (0,0) is a loop and forms the second weakly connected component. Therefore, a(3)=2.
		

References

  • E. R. Berlekamp, J. H. Conway, and R. K. Guy, Winning Ways for Your Mathematical Plays, Vol. 1, CRC Press, 2001.

Crossrefs

Programs

  • Mathematica
    Upto=25;
    Table[
      VertexSet:={};
      EdgeSet:={};
      (* Compute configuration graph for integers mod n *)
      Do[
        Do[AppendTo[VertexSet,{i,j}];
          AppendTo[EdgeSet,{i,j}\[DirectedEdge]{Mod[i-j,n],Mod[i+j,n]}];
          AppendTo[EdgeSet,{i,j}\[DirectedEdge]{Mod[j+i,n],Mod[j-i,n]}],
          {j,0,n-1}],
        {i,0,n-1}];
      (* Print n-th term *)
      Length[WeaklyConnectedComponents[Graph[VertexSet,EdgeSet]]],
      {n,2,Upto}]

A364503 Sprague-Grundy values for Heat-Charge Toggle on paths from A364489 where paths with an even number of vertices are odious, or paths with an odd number of vertices are evil.

Original entry on oeis.org

0, 2, 1, 3, 2, 2, 3, 4, 5, 3, 7, 3, 4, 4, 6, 5, 5, 6, 4, 7, 6, 3, 10, 4, 16, 18, 16, 32, 32, 32, 32, 32, 36, 32, 36, 32, 33, 36, 32, 33, 32, 32, 32, 35, 33, 34, 34, 36, 35, 33, 33, 32, 36, 32, 33, 32, 36, 34, 34, 37, 37, 34
Offset: 1

Keywords

Comments

See A364489 for the rules of Heat-Charge Toggle.

Examples

			a(2) = 2, which is odious. So the second term of A364489 is an even number.
		

References

  • E. R. Berlekamp, J. H. Conway, and R. K. Guy, Winning Ways for Your Mathematical Plays, Vol. 1, CRC Press, 2001.

Crossrefs

Cf. A000069, A001969, A363934. Sprague-Grundy values of A364489.

A364489 Values of n for which the Sprague-Grundy value of Heat-Charge Toggle on an (n+2)-vertex path with initial weights -1,1^n,-1 is evil for odd n or odious for even n.

Original entry on oeis.org

1, 4, 6, 9, 14, 22, 27, 30, 35, 41, 58, 59, 72, 84, 87, 89, 103, 105, 108, 124, 129, 141, 171, 258, 284, 407, 458, 11770548, 25146268, 27690032, 41693544, 55788270, 74838555, 86120064, 89811321, 95580294, 119784327, 139336981, 158776090, 160066751, 161102638, 181691114, 186919128
Offset: 1

Keywords

Comments

Heat-Charge Toggle is an impartial two-player game on a finite simple graph, where each vertex is assigned a weight of -1, 0, or 1.
A Heat-Charge Toggle move consists of selecting a vertex of weight 1 and switching its weight to 0, as well as switching the sign of each of its neighbors: changing 1 to -1, -1 to 1, and keeping 0 at 0.
We additionally only allow moves that strictly decrease the sum of all weights.
The two vertices of degree one have initial weights of -1, while vertices of degree two have an initial weight of 1.

Examples

			For n = 4, the Sprague-Grundy value for a 6-vertex path is 2.
Note that n = 4 is even and 2 is odious (see A000069).
		

References

  • E. R. Berlekamp, J. H. Conway, and R. K. Guy, Winning Ways for Your Mathematical Plays, Vol. 1, CRC Press, 2001.

Crossrefs

Cf. A000069, A001969, A361517, A363934. Paths with Sprague-Grundy values A364503.

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.

Original entry on oeis.org

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, 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
Offset: 1

Keywords

Comments

Heat Toggle is an impartial two-player game played on a simple graph, where each vertex is assigned a weight of -1 or 1.
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.
The first row T(1,k) coincides with octal game 0.1337, see A071427.
The second row T(2,k) coincides with the octal game 0.137 (Dawson's Chess), see A002187.

Examples

			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.
The table T(n,k) begins:
[n/k]  1   2   3   4   5   6  ...
---------------------------------
[1]    1,  1,  1,  2,  2,  0, ...
[2]    1,  1,  2,  0,  3,  1, ...
[3]    1,  2,  1,  1,  3,  0, ...
[4]    2,  0,  1,  0,  1,  0, ...
[5]    2,  3,  3,  1,  2,  0, ...
[6]    0,  1,  0,  0,  0,  ...
		

References

  • E. R. Berlekamp, J. H. Conway, and R. K. Guy, Winning Ways for Your Mathematical Plays, Vol. 1, CRC Press, 2001.

Crossrefs

Programs

  • Sage
    SG_value_hash = {}
    def MEX(S):
        i = 0
        while True:
            if i not in S:
                return i
            i += 1
    def SG_value(G):
        global SG_value_hash
        SG_value_hash = {}
        ons = set(G.vertices())
        offs = set()
        return SG_value_helper(G, ons, offs)
    def SG_value_helper(G, ons, offs):
        ons_orig = ons.copy()
        offs_orig = offs.copy()
        child_SG_values = set()
        for v in ons_orig:
            vNeighborhood = set(G.neighbors(v))
            neighNowOff = ons_orig.intersection(vNeighborhood)
            neighNowOn = offs_orig.intersection(vNeighborhood)
            if len(neighNowOff) >= len(neighNowOn):
                ons.remove(v)
                offs.add(v)
                ons.update(neighNowOn)
                offs -= neighNowOn
                offs.update(neighNowOff)
                ons -= neighNowOff
                result = -1 # placeholder
                encoded_position = str(offs)
                if encoded_position in SG_value_hash:
                    result = SG_value_hash[encoded_position]
                else:
                    result = SG_value_helper(G, ons, offs)
                SG_value_hash[encoded_position] = result
                ons.add(v)
                offs.remove(v)
                ons -= neighNowOn
                offs.update(neighNowOn)
                offs -= neighNowOff
                ons.update(neighNowOff)
                child_SG_values.add(result)
        return MEX(child_SG_values)
    for sum_of_both in range(2,11):
        antidiagonal = []
        for n in range(1, sum_of_both):
            G = graphs.Grid2dGraph(n, sum_of_both-n)
            antidiagonal.append(SG_value(G))
        print(antidiagonal)