This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Superpolynomial period lengths of the winning positions in the subtraction game

István Miklós Logan Post
Abstract

Given a finite set of positive integers, AA, and starting with a heap of nn chips, Alice and Bob alternate turns and on each turn a player chooses xAx\in A with xx smaller or equal than the current number of chips and subtract xx chips from the heap. The game terminates when the current number of chips becomes smaller than min{A}\min\{A\} and no moves are possible. The player who makes the last move is the winner. We can define wA(n)w^{A}(n) to be 11 if Alice has a winning strategy with a starting heap of nn chips and 0 if Bob has a winning strategy. By the Pigeonhole Principle, wA(n)w^{A}(n) becomes periodic, and it is easy to see that the period length is at most an exponential function of max{A}\max\{A\}. The typical period length is a linear function of max{A}\max\{A\}, and it is a long time open question if exponential period length is possible.

We consider a slight modification of this game by introducing an initial seed SS that tells for the few initial numbers of chips whether the current or the opposite player is the winner. In this paper we show that the initial seed cannot change the period length of wA(n)w^{A}(n) if the size of AA is 11 or 22, but it can change the period length with |A|3|A|\geq 3. Further, we exhibit a class of sets AA of size 33 and corresponding initial seeds such that the period length becomes a superpolynomial function of max{A}\max\{A\}.

1 Introduction

Game Theory is the theory of interactive situations or games among rational decision-makers or players in which the decisions of each player are contingent on the decisions of the others. Combinatorial Game Theory considers games with perfect information and without elements of chance. That is, at all times during the game, players have perfect information about the state of the game, and further, the moves in the game are entirely decided by the players, there is no elements of chance once the game has begun. We further require that a combinatorial game must end with a clear winner.

An example of a two-player combinatorial game is the subtraction game. For a finite set A+A\subset\mathbb{N}_{+}, the AA-subtraction game is a two-player combinatorial game which proceeds as follows. We begin with heap of nn-chips. Players Alice and Bob alternate turns, and on each turn a player chooses xAx\in A with xnx\leq n, and subtracts xx chips from the heap, leaving nxn-x remaining. The game terminates when n<min(A)n<\min(A) and thus no moves are possible. The player who makes the last move is the winner. In general we consider a fixed AA and ask for which values of nn each player has a winning strategy. Note that when Alice makes a move xx, Bob and Alice switch roles and we reduce to the nxn-x game.

The subtraction game is also in the large class of combinatorial games called impartial games. An impartial game is a combinatorial game in which the allowable moves depend only on the position and not on which of the two players is currently moving, and where the payoffs are symmetric. It is also in normal mode, meaning that the winner is who can make the last possible move. The Sprague-Grundy theorem [11, 8] says that any impartial game in normal mode is equivalent with a Nim game, which is the disjunctive sum of +\mathbb{N}_{+}-subtraction games. Despite this reduction, we know little about the patterns of the winning positions of the subtraction game.

For any finite set A+A\subset\mathbb{N}_{+}, a dynamic programming recursion can compute which player has the winning strategy starting with a pile of size nn. Simple reasoning by Pigeonhole Principle shows that the pattern of winning positions will eventually become periodic as nn takes all possible positive integers, and the period length cannot be longer than 2max(A)2^{\max(A)}. It is a long time open question if exponential period lengths exist in the substraction game. Althöfer and Bültermann conjectured that superpolynomial period lengths might exist if |A|5|A|\geq 5 [1].

For some AA, the subtraction game has a pre-period in the winning positions before becomeing periodic, that is, a pattern of winning positions for small nn that is never repeated. We also know little about for which AA the subtraction game has a pre-period and for which AA it is purely periodic, that is, has no pre-period.

In this paper, we generalize the subtraction game by modifying who is the winner for some small nn. We call this initial pattern a seed. We give a complete analysis of subtraction games with seeds for |A|=1|A|=1 and 22. We prove that for all seeds the game has no pre-period if |A|=1|A|=1 or 22. For A={a}A=\{a\}, the period length is 2a2a. For A={a,b}A=\{a,b\}, the period length can be any divisor of a+ba+b, with a few exceptions. If aa and bb are relatively prime then the period can be any divisor except 11, 44, and 66. We also compute the number of possible distinct period lengths over all seeds. When |A|=3|A|=3, then there might be pre-periods. We give characterisations of period and pre-period lengths for a large class of possible sets AA. Finally, we show that superpolynomial period lengths exist already when |A|=3|A|=3.

2 Preliminaries

Definition 1.

Let wA(n)w^{A}(n) be the winning indicator function of AA, so wA(n)=1w^{A}(n)=1 if Alice (the first player) has a winning strategy and wA(n)=0w^{A}(n)=0 if Bob has a winning strategy.

For brevity, we may use w(n)w(n) to refer to wA(n)w^{A}(n). By definition, ww satisfies the recurrence relation

w(n)={1w(nx)=0 for some xA0w(nx)=1 for all xA=1min{w(nx)xA}.w(n)=\begin{cases}1&w(n-x)=0\text{ for some }x\in A\\ 0&w(n-x)=1\text{ for all }x\in A\end{cases}=1-\min\{w(n-x)\mid x\in A\}. (1)

This follows from the observation that for a particular nn, Alice is in a winning position if she can subtract some xx to give Bob a losing position. Otherwise, she will certainly move to a winning position for Bob, and he will win. We can then also describe wAw^{A} as the lexicographically least sequence in nn such that for all xAx\in A, w(n)=0w(n+x)=1w(n)=0\implies w(n+x)=1.

Note that it is natural to define w(0):=0w(0):=0, because if a player has previously made a move to 0, then the next player will lose. Therefore, to satisfy recurrence relation (1) we shall define w(n):=1w(n):=1 for all n<0n<0.

To describe an entire sequence {wA(n)}n=0\{w^{A}(n)\}_{n=0}^{\infty} of winning positions, abbreviated as {wA}\{w^{A}\}, we use exponents to denote repeated values. A noted example in [3, p. 86] is the set {2,4,7}\{2,4,7\}. We find that {w{2,4,7}}=0,0,1,1,1,1,0,1,1,0,\{w^{\{2,4,7\}}\}=0,0,1,1,1,1,0,1,1,0,\ldots, which can be abbreviated to {w{2,4,7}}=02140120=0212(120)\{w^{\{2,4,7\}}\}=0^{2}1^{4}01^{2}0\ldots=0^{2}1^{2}(1^{2}0)^{\infty}. In this example we have w(0)=0w(0)=0, w(1)=0w(1)=0, and w(2)=1w(2)=1. This follows from the rule that if n<2n<2, Alice is unable to move, but at n=2n=2, Alice may subtract 2 chips and win the game. Similarly w(6)=0w(6)=0 because for any move Alice makes, Bob can respond with a winning move. In general, if we present a prefix of {wA}\{w^{A}\} of length \ell, we use “\underset{\ell}{\ldots}” to indicate the continuation of the sequence and clarify the prefix’s length for the reader. For example, {w{2,4,7}}=02146\{w^{\{2,4,7\}}\}=0^{2}1^{4}\underset{6}{\ldots} may indicate that the first 66 values of ww are given and the rest are not yet derived. Throughout the paper, we refer to α=max(A)\alpha=\max(A). The following example is an easy generalization of one in [3, p. 103].

Example 2.1.

Suppose A={1,2,,α}A=\{1,2,\ldots,\alpha\}. Then wA(n)={0(α+1)n1otherwisew^{A}(n)=\begin{cases}0&(\alpha+1)\mid n\\ 1&\text{otherwise}\end{cases}, so {wA}=( 01α)\{w^{A}\}=\big{(}\,01^{\alpha}\,\big{)}^{\infty}.

Proof.

Suppose n=k(α+1)n=k(\alpha+1). We claim Bob has a winning strategy. If Alice subtracts xx, then Bob can subtract α+1x\alpha+1-x, reducing to (k1)(α+1)(k-1)(\alpha+1) chips. Bob can repeat this until there are (0)(α+1)(0)(\alpha+1) chips, winning the game. Suppose n=k(α+1)+yn=k(\alpha+1)+y. Then Alice has a winning strategy. She may yy chips, reducing the game to k(α+1)k(\alpha+1), then play as Bob would by countering each of his moves xx with α+1x\alpha+1-x. ∎

We define a notation for repeated concatenation of strings. By analogy to addition, for strings w1,w2,wkw_{1},w_{2},\ldots w_{k}, let

i=1kwi=w1w2wk.\sum_{i=1}^{k}w_{i}=w_{1}\circ w_{2}\circ\ldots\circ w_{k}.

This notation satisfies the equality |i=1kwi|=i=1k|wi|\left\lvert\sum_{i=1}^{k}w_{i}\right\rvert=\sum_{i=1}^{k}\left\lvert w_{i}\right\rvert. Recall that sequence concatenation is not a commutative operation, although the usual summation of numbers is one. When we use a summation symbol for a concatenation of strings, we will always use an index that defines the order of the concatenation.

Definition 2.

A sequence {wA(n)}\{w^{A}(n)\} is periodic over pp if there is some NN\in\mathbb{N} such that for all nNn\geq N, wA(n)=wA(n+p)w^{A}(n)=w^{A}(n+p). We say the period of wA(n)w^{A}(n) is the least such pp and the preperiod is the least such NN. We denote these by Per(A)\operatorname{Per}(A) and PrePer(A)\operatorname{PrePer}(A) respectively.

In Example 2.1 we have Per({1,,α})=α+1\operatorname{Per}(\{1,\ldots,\alpha\})=\alpha+1 and PrePer({1,,α})=0\operatorname{PrePer}(\{1,\ldots,\alpha\})=0. We also observe that Per({2,4,7})=3\operatorname{Per}(\{2,4,7\})=3 and PrePer({2,4,7}=4\operatorname{PrePer}(\{2,4,7\}=4, because for all n4n\geq 4 it holds that w(n)=w(n+3)w(n)=w(n+3).

Lemma 2.2.

For any finite set A+A\subset\mathbb{N}_{+}, {wA(n)}\{w^{A}(n)\} is periodic.

Proof.

To prove this fact, we define a new tool called the vector of previous values. Given A+A\subset\mathbb{N}_{+}, let

vA(n):=w(nα),,w(n2),w(n1)=v1,,vα2α.\vec{v}^{A}(n):=\left\langle w(n-\alpha),\ldots,w(n-2),w(n-1)\right\rangle=\left\langle v_{1},\ldots,v_{\alpha}\right\rangle\in\mathbb{Z}_{2}^{\alpha}. (2)

As shown above, v(n)\vec{v}(n) will be an element of 2α\mathbb{Z}_{2}^{\alpha}. Next, we use the recurrence relation to define a function :2α2α\mathcal{F}:\mathbb{Z}_{2}^{\alpha}\to\mathbb{Z}_{2}^{\alpha}.

(v):=v2,v3,,vα1,1min{vαxxA}\mathcal{F}(\vec{v}):=\left\langle v_{2},v_{3},\ldots,v_{\alpha-1},1-\min\{v_{\alpha-x}\mid x\in A\}\right\rangle (3)

Thus by Recurrence 1, we have v(n+1)=(v(n))\vec{v}(n+1)=\mathcal{F}\big{(}\vec{v}(n)\big{)}. Note that 2α\mathbb{Z}_{2}^{\alpha} has 2α2^{\alpha} elements, so by the Pigeonhole Principle there must be distinct integers 0N<M2α0\leq N<M\leq 2^{\alpha} such that v(N)=v(M)\vec{v}(N)=\vec{v}(M). Therefore for all nNn\geq N, we have the equality

v(n)=nN(v(N))=FnN(v(M))=v(n+MN).\vec{v}(n)=\mathcal{F}^{n-N}\big{(}\vec{v}(N)\big{)}=F^{n-N}\left(\vec{v}(M)\right)=\vec{v}(n+M-N).

Therefore a single repeated vector guarantees periodicity of length MNM-N. ∎

Indeed this Lemma often fails for infinite set games.

Proposition 2.3.

For some k2k\geq 2, suppose A={nkn}A=\{n^{k}\mid n\in\mathbb{N}\}. Then the sequence wAw^{A} is not periodic.111For k=2k=2, the losing positions of this sequence are in the Online Encyclopedia of Integer Sequences [10, A030193]

Proof.

We first show there must be infinitely many losing positions by contradiction. Suppose there are \ell losing positions. Among all integers (2)k\leq(2\ell)^{k}, there are 22\ell elements of AA. Because each winning position can be expressed as a losing position plus some xAx\in A, there can be combinatorially at most 222\ell^{2} distinct winning positions (2)k\leq(2\ell)^{k}. This implies +22(2)k\ell+2\ell^{2}\geq(2\ell)^{k}, which contradicts finiteness of losing positions. Thus {wA}\{w^{A}\} has infinitely many zeros. If we suppose ww is periodic after some NN with period pp, then there is some n>Nn>N with w(n)=0w(n)=0. This implies that after pk1p^{k-1} periods, we will have w(n+pk)=0w(n+p^{k})=0, contradicting pkAp^{k}\in A. ∎

The proof of Lemma 2.2 gives the result that for any finite AA, PrePer(A)+Per(A)2α\operatorname{PrePer}(A)+\operatorname{Per}(A)\leq 2^{\alpha}. We can get a slightly tighter bound for dense sets, but no less than exponential in α\alpha.

Theorem 2.4.

For A={a1,a2,,α,α}A=\{a_{1},a_{2},\ldots,\alpha^{\prime},\alpha\}, let β=min(α,a1+α)\beta=\min(\alpha,a_{1}+\alpha^{\prime}). Then

PrePer(A)+Per(A)(β+1)2α|A|.\operatorname{PrePer}(A)+\operatorname{Per}(A)\leq(\beta+1)2^{\alpha-|A|}. (4)
Proof.

First, we show that there cannot be a string of ones longer than β\beta in {wA}\{w^{A}\}. If some w(n)w(n) is preceded by a string of α\alpha ones, then w(nx)=1w(n-x)=1 for all xAx\in A, so w(n)=0w(n)=0. Alternately, if nn is preceded by a string of a1+αa_{1}+\alpha^{\prime} ones, this implies that in particular w(na1)=1w(n-a_{1})=1, and (na1)(n-a_{1}) is preceded by α\alpha^{\prime} ones. This means that for all aiAa_{i}\in A except for α\alpha, we have aiαa_{i}\leq\alpha^{\prime} and therefore w(na1ai)=1w(n-a_{1}-a_{i})=1. Because w(na1)=1w(n-a_{1})=1, by process of elimination we conclude that w(na1α)=0w(n-a_{1}-\alpha)=0. Therefore w(nα)=1w(n-\alpha)=1. Thus w(nx)=1w(n-x)=1 for all xAx\in A, so w(n)=0w(n)=0. Hence β\beta bounds the number of consecutive ones in {wA}\{w^{A}\}.

Now, let nin_{i} be the ithi^{th} zero in {wA}\{w^{A}\}. By the proof above nini1β+1n_{i}-n_{i-1}\leq\beta+1, so nii(β+1)n_{i}\leq i(\beta+1). In order to have w(ni)=0w(n_{i})=0, we require that within the vector v(ni)\vec{v}(n_{i}), the αxth{\alpha-x}^{\text{th}} entry v(ni)αx=1\vec{v}(n_{i})_{\alpha-x}=1 for all xAx\in A. This fixes |A||A| entries, so there are 2α|A|2^{\alpha-|A|} possibilities for v(ni)\vec{v}(n_{i}). By the Pigeonhole Principle, there is some repeated vector vnN=vnM\vec{v}_{n_{N}}=\vec{v}_{n_{M}} for some N<M2α|A|N<M\leq 2^{\alpha-|A|}, and nM(β+1)2α|A|n_{M}\leq(\beta+1)2^{\alpha-|A|}. This proves the claim. ∎

A similar argument can give a bound of (|A|+1)2α|A|(|A|+1)2^{\alpha-|A|}. Using the approach from Proposition 2.3, we can see that there are at most (2α|A|1)(|A|)(2^{\alpha-|A|}-1)\cdot(|A|) ways to express a winning position less than n2α|A|n_{2^{\alpha-|A|}}, which yields this improved constant.

2.1 Initial Seed

We can generalize the subtraction game by changing the end state of the game. In [1, (ix)], Althöfer and Bülterman suggest that this variant “may be interpreted as simulations of certain computing devices,” and pose open questions about this game. Through the analysis in Sections 3, 4, and 6 we find that this generalization also provides insights into the original game. We begin with two motivating examples.

Example 2.5.

The Miseré mode of the AA-subtraction game is the same game except the player to make the last move is the loser.

Example 2.6.

The Greedy mode of the AA-subtraction game is the same game except a player may take x>nx>n chips, thereby making the heap negative. The game concludes when then heap is negative, and the player to make the last move is the winner. This is close to the version studied in [1].222The exact game studied in [1] is the same but has w(0):=0w(0):=0; this cannot be generated from a seed as there is no function w:{0,1}w:\mathbb{Z}\to\{0,1\} satisfying recurrence 1 for all nn\in\mathbb{N}. For example, if A={1,3}A=\{1,3\}, we desire w(0)=0w(0)=0, w(1)=1w(1)=1, and w(2)=1w(2)=1. Any choice of w(1)w(-1) leads to a contradiction.

Notice that for nαn\geq\alpha, the recurrence relation for both of these games is the same as Equation (1), but the ultimate sequence of winning positions may be different because of the players’ final goals. We can account for this by adjusting negative values of w(n)w(n), then allowing the recurrence relation to proceed for n0n\geq 0.

Definition 3.

Define the seed SS of a game to be the value of v(0)\vec{v}(0), determining w(n)w(n) for n[α,0)n\in[-\alpha,0). The recurrence relation follows, so v(n):=n(S)\vec{v}(n):=\mathcal{F}^{n}(S), with \mathcal{F} defined in Equation (3). We define {wA,S(n)}n=0\{w^{A,S}(n)\}_{n=0}^{\infty} to be the sequence generated by seed SS. Further define Per(A,S)\operatorname{Per}(A,S) and PrePer(A,S)\operatorname{PrePer}(A,S) to be the period and preperiod of {wA,S}\{w^{A,S}\}.

For ease of notation, we interpret SS more generally as the negative values of wA(n)w^{A}(n). Ordinarily |S|α|S|\leq\alpha, and if not then vA,S(0)\vec{v}^{A,S}(0) is taken to be the last α\alpha elements of SS. Similarly, if |S|<α|S|<\alpha, then we presume SS to be preceded by infinitely many 11’s, so let w{A,S}:=w{A,1α|S|S}w^{\{A,S\}}:=w^{\{A,1^{\alpha-|S|}S\}}. It follows from this convention and Definition 2 that Per(A)=Per(A,1α)\operatorname{Per}(A)=\operatorname{Per}(A,1^{\alpha}), and thus in general we refer to a game with seed 1α1^{\alpha} as having ‘no seed’.

In Example 2.5, we observe that S=0min(A)1αmin(A)S=0^{\min(A)}1^{\alpha-\min(A)} generates the sequence of winning positions for the Miseré mode of the subtraction game, and in Example 2.6, we see that S=0αS=0^{\alpha} generates the sequence for the Greedy game. By considering all seeds in 2α\mathbb{Z}_{2}^{\alpha} we describe a larger class of games. Some seeds generate games which are similar or identical to the original, while some are dramatically different. For example, the Miseré and Greedy modes cause only a translation in w(n)w(n) by min(A)\min(A) and α\alpha respectively.

Notice that Results 2.2 - 2.4 consider the recurrence in generality and therefore hold for all seeds. In order to characterize wA,Sw^{A,S} over all seeds, we provide the following notation for the set of all winning sequences and their periods.

𝒲A\displaystyle\mathcal{W}^{A} :={{wA,S(n)}n=0S{0,1}α}\displaystyle:=\Big{\{}\{w^{A,S}(n)\}_{n=0}^{\infty}\mid S\in\{0,1\}^{\alpha}\Big{\}} (5)
𝒫A\displaystyle\mathcal{P}^{A} :={Per(A,S)S{0,1}α}\displaystyle:=\Big{\{}\operatorname{Per}(A,S)\mid S\in\{0,1\}^{\alpha}\Big{\}} (6)

Thus 𝒲A\mathcal{W}^{A} is the set of all (A,S)(A,S) games, i.e. all sequences satisfying recurrence relation 1, and 𝒫A\mathcal{P}^{A} is the set of their periods. For general AA, a natural open question is to find max(𝒫A)\max(\mathcal{P}^{A}).

2.2 Properties of Subtraction Games.

If the elements of AA are not coprime, we can interpret the sequence ww as multiple games (w)i(w)_{i} proceeding in parallel. Formally, choose finite A+A\subset\mathbb{N}_{+} with maximum α\alpha and gcd\gcd 11, and denote kA={kxxA}kA=\{kx\mid x\in A\}. Then given some seed SS with |S|=kα|S|=k\alpha, where S=S(m)m{0,,kα1}S=\left\langle S(m)\mid m\in\{0,\ldots,k\alpha-1\}\right\rangle, we break SS into classes modulo kk by defining SiS_{i} for i{0,k1}i\in\{0,\ldots k-1\} such that for all m{0,α1}m\in\{0,\ldots\alpha-1\}, we have Si(m):=S(mk+i)S_{i}(m):=S(mk+i). Thus |Si|=α|S_{i}|=\alpha and SS can be decomposed into SiS_{i}’s. By analogy, similarly define (wkA,S)i(m):=wkA,S(mk+i)(w^{kA,S})_{i}(m):=w^{kA,S}(mk+i). We observe that {(wkA,S)i(m)}m=0\{(w^{kA,S})_{i}(m)\}_{m=0}^{\infty} depends only on SiS_{i}.

Proposition 2.7 (Multiplicative Linearity).

For any kk\in\mathbb{N}, set AA, and seed SS with |S|=kα|S|=k\alpha, then

(wkA,S)i(m)=wA,Si(m)(w^{kA,S})_{i}(m)=w^{A,S_{i}}(m) (7)

So if Si=S0S_{i}=S_{0} for all i{0,,k1}i\in\{0,\ldots,k-1\}, then Per(kA,S)=kPer(A,S0)\operatorname{Per}(kA,S)=k\operatorname{Per}(A,S_{0}) and PrePer(kA,S)=kPrePer(A,S0)\operatorname{PrePer}(kA,S)=k\operatorname{PrePer}(A,S_{0}). This condition holds for S=1kαS=1^{k\alpha}, implying that Per(kA)=kPer(A)\operatorname{Per}(kA)=k\operatorname{Per}(A) and wkA(n)=wA(n/k)w^{kA}(n)=w^{A}(\left\lfloor n/k\right\rfloor). \square

Proposition 2.7 follows by applying the recurrence relation to (wkA,S)i(m)(w^{kA,S})_{i}(m).

Definition 4 (Extension).

Choose set A+A\subset\mathbb{N}_{+} and seed SS. We say bAb\in\mathbb{N}\setminus A is an extension of (A,S)(A,S) if wA{b},S=wA,Sw^{A\cup\{b\},S}=w^{A,S}.

Proposition 2.8 (Better Definition of Extension).

For bAb\in\mathbb{N}\setminus A is an extension of (A,S)(A,S) if and only if for all nn\in\mathbb{N} it holds that wA,S(n)=0wA,S(nb)=1w^{A,S}(n)=0\implies w^{A,S}(n-b)=1.

Proof.

Let B=A{b}B=A\cup\{b\}. Suppose it holds that wA,S(n)=0wA,S(nb)=1w^{A,S}(n)=0\implies w^{A,S}(n-b)=1, but wB,SwA,Sw^{B,S}\neq w^{A,S}, and choose the least nn\in\mathbb{N} where they differ. If wA,S(n)=1w^{A,S}(n)=1, then for some xAx\in A, wA,S(nx)=wB,S(nx)=0w^{A,S}(n-x)=w^{B,S}(n-x)=0, so wB,S(n)=1w^{B,S}(n)=1. If instead wA,S(n)=0w^{A,S}(n)=0, then wA,S(nb)=wB,S(nb)=1w^{A,S}(n-b)=w^{B,S}(n-b)=1, so indeed wB,S=0w^{B,S}=0, contradicting that wB,SwA,Sw^{B,S}\neq w^{A,S}.

In the other direction, suppose wB,S=wA,Sw^{B,S}=w^{A,S} but there is some nn with wB,S(n)=wA,S(n)=0w^{B,S}(n)=w^{A,S}(n)=0 and wB,S(nb)=wA,S(nb)=0w^{B,S}(n-b)=w^{A,S}(n-b)=0. This contradicts the recurrence relation for BB. ∎

This means that we can identify redundant elements of a set AA if they are extensions of the other elements. The following proposition is a digression, but

Proposition 2.9.

For all finite or infinite sets A+A\subseteq\mathbb{N}_{+}, if PrePer(A)=0\operatorname{PrePer}(A)=0 and Per(A)=p\operatorname{Per}(A)=p, then wA=wA{1,,p}w^{A}=w^{A\cap\{1,\ldots,p\}}, so every element of AA greater than pp is redundant as an extension of A{1,,p}A\cap\{1,\ldots,p\}. There is no analogous statement for sequences with preperiods; for example {w{1,4,7,}}=0(101)\{w^{\{1,4,7,\ldots\}}\}=0(101)^{\infty}, but no other set generates that sequence.

Proof.

For the first statement, let B=A{1,,p}B=A\cap\{1,\ldots,p\}. Suppose for the sake of contradiction there is some least nn such that wA(n)wB(n)w^{A}(n)\neq w^{B}(n). By the recurrence relation it must be that wA(n)=1w^{A}(n)=1 and wB(n)=0w^{B}(n)=0, and wA(na)=0w^{A}(n-a)=0 for some aABa\in A\setminus B. By our definitions a>pa>p so n>pn>p. Then wB(np)=wA(np)=1w^{B}(n-p)=w^{A}(n-p)=1 so there is some xBx\in B such that wB(npx)=0w^{B}(n-p-x)=0. Therefore wB(nx)=0w^{B}(n-x)=0, so wB(n)=1w^{B}(n)=1, a contradiction. For the second statement, suppose wA=0(101)w^{A}=0(101)^{\infty}. Suppose x0(mod3)x\equiv 0\pmod{3}. Then wA(2)=wA(2+x)=0w^{A}(2)=w^{A}(2+x)=0, so xAx\notin A. Suppose x2(mod3)x\equiv 2\pmod{3}. Then wA(0)=wA(x)=0w^{A}(0)=w^{A}(x)=0, so xAx\notin A. Therefore A3+1={1,4,7,}A\subseteq 3\mathbb{N}+1=\{1,4,7,\ldots\}. It is easy to see that A=3+1A=3\mathbb{N}+1 is a valid choice. Suppose A3+1A\subsetneq 3\mathbb{N}+1, and 3k+13k+1 is the least element of 3+1A3\mathbb{N}+1\setminus A. Then surely wA(n)=w3+1(n)w^{A}(n)=w^{3\mathbb{N}+1}(n) for all n<3k+1n<3k+1. However, for all 3j+1A3j+1\in A, j<kj<k, wA(3k+1(3j+1))=wA(3(kj))=1w^{A}(3k+1-(3j+1))=w^{A}(3(k-j))=1, so wA(3k+1)=0w^{A}(3k+1)=0, a contradiction. Thus 3+13\mathbb{N}+1 is the only set generating this sequence.∎

The following proposition gives another way to identify these extensions, which we use later in the paper.

Proposition 2.10.

If {wA}\{w^{A}\} is periodic over pp and PrePer(A)=0\operatorname{PrePer}(A)=0, then for all xAx\in A and k1k\geq 1, b=kp+xb=kp+x is an extension of AA.

Proof.

Suppose Per(A)p\operatorname{Per}(A)\mid p and PrePer(A)=0\operatorname{PrePer}(A)=0. Choose any xAx\in A and k1k\geq 1, and nn\in\mathbb{N} such that wA(n)=0w^{A}(n)=0. By the recurrence wA(nx)=1w^{A}(n-x)=1. If nxkp0n-x-kp\geq 0, then by periodicity wA(nxkp)=1w^{A}(n-x-kp)=1. Otherwise, wA(nxkp)=1w^{A}(n-x-kp)=1 because we have no seed. Thus by the better definition bb is an extension of AA. ∎

The following elementary example can be found in [9, thm 1].

Example 2.11.

If A={1}A=\{1\}, then {wA}=(01)\{w^{A}\}=(01)^{\infty}, so Per(A)=2\operatorname{Per}(A)=2 and PrePer(A)=0\operatorname{PrePer}(A)=0. Because 1A1\in A, any odd number 2k+12k+1 is an extension of AA.

From Example 2.1, if {1,,k1}B\{1,\ldots,k-1\}\subseteq B and Bk=B\cap k\mathbb{N}=\emptyset, then {wB}=(01k1)\{w^{B}\}=(01^{k-1})^{\infty} and Per(B)=k\operatorname{Per}(B)=k. The set B={1}{pp prime}B=\{1\}\cup\{p\mid p\text{ prime}\} is an example for k=4k=4.

We must be careful to note that Proposition 2.10 does not hold for all seeds. If we do allow for initial seeds |S|α|S|\leq\alpha, the induction step fails for n[p+xα,p)n\in[p+x-\alpha,p). This margin leads to many counterexamples; we provide two. Let A={3,5}A=\{3,5\} and S=0110S=0110. We find Per(A,S)=8\operatorname{Per}(A,S)=8 and PrePer(A,S)=0\operatorname{PrePer}(A,S)=0, so let b=8+3=11b=8+3=11. Then:

{wA,S}=(01502)and{wA{b},S}=01501013(01)\{w^{A,S}\}=(01^{5}0^{2})^{\infty}\hskip 20.0pt\text{and}\hskip 20.0pt\{w^{A\cup\{b\},S}\}=01^{5}0101^{3}(01)^{\infty}

These are vastly different and we even caused a preperiod of length 1212. As another example:

{w{3,6,8},0213}=(0113(01)3)and{w{3,6,8,12},0213}=(0140130013).\{w^{\{3,6,8\},0^{2}1^{3}}\}=(011^{3}(01)^{3})^{\infty}\hskip 20.0pt\text{and}\hskip 20.0pt\{w^{\{3,6,8,12\},0^{2}1^{3}}\}=(01^{4}01^{3}001^{3})^{\infty}.

We also note that the converse of Proposition 2.10 does not hold, though it appears to hold if |A|3|A|\leq 3. For example, let A={1,2,6,11}A=\{1,2,6,11\}. Then {wA}=0(12013(012)2)\{w^{A}\}=0\big{(}1^{2}01^{3}(01^{2})^{2}\big{)}^{\infty}, so Per(A)=12\operatorname{Per}(A)=12, PrePer(A)=1\operatorname{PrePer}(A)=1. However it is true that for all k1k\geq 1 and xAx\in A, b=12k+xb=12k+x is indeed an extension of AA. Also see the counterexample {1,8,13,16}\{1,8,13,16\}.

Contrasting these complex examples with Example 2.11, we see that sequences are easiest to examine with no seed and no preperiod. The following Lemma can simplify the process of checking whether a sequence is in this form.

Lemma 2.12 (Translating zeros).

Given a set AA, then for any pp\in\mathbb{N}, wAw^{A} is periodic over pp and has no preperiod if and only if it holds for all xAx\in A and m<xm<x that

wA(m)=0wA(m+px)=1.w^{A}(m)=0\hskip 10.0pt\implies\hskip 10.0ptw^{A}(m+p-x)=1.

We call this “translating zeros” because w(m)=0w(m+px)=1w(m)=0\implies w(m+p-x)=1 suggests that w(m+p)=0w(m+p)=0, but does not discuss the translation of the 11’s. Note that it does not a priori imply that the zeros translate, since only m<xm<x is considered.

Proof.

Suppose for the sake of contradiction that the premise w(m)=0w(m+px)=1w(m)=0\implies w(m+p-x)=1 holds but there is some least mm\in\mathbb{N} such that w(m)w(m+p)w(m)\neq w(m+p). There are two cases.

  1. (i)

    If w(m)=1w(m)=1, then w(m+p)=0w(m+p)=0, so there is some xAx\in A such that w(mx)=0w(m-x)=0 but w(m+px)=1w(m+p-x)=1. Because there is no seed this implies mx0m-x\geq 0, and because w(mx)w(mx+p)w(m-x)\neq w(m-x+p) this contradicts the minimality of mm.

  2. (ii)

    If w(m)=0w(m)=0, then w(m+p)=1w(m+p)=1, so there is some xAx\in A with w(m+px)=0w(m+p-x)=0 but w(mx)=1w(m-x)=1. If mx0m-x\geq 0, then this would contradict the minimiality of nn. Otherwise, m<xm<x and w(m)=0w(m)=0, so the premise implies that w(m+px)=1w(m+p-x)=1, a contradiction.

Either case leads to a contradiction, so for all m0m\geq 0, we have w(m)=w(m+p)w(m)=w(m+p). In the other direction, if ww is periodic with no preperiod then the condition follows by definition. ∎

Corollary 2.12.1.

If A={a,b,c}A=\{a,b,c\} for any a<b,ca<b,c, then Per(A)(b+c)\operatorname{Per}(A)\mid(b+c) and PrePer(A)=0\operatorname{PrePer}(A)=0 if and only if wA(b+ci)=1w^{A}(b+c-i)=1 for all i[1,a]i\in[1,a].

Proof.

Apply Lemma 2.12 for p=b+cp=b+c. For all xAx\in A, if x=bx=b, then w(m)=0w(m+pb)=w(m+c)=1w(m)=0\implies w(m+p-b)=w(m+c)=1 by the recurrence. If x=cx=c, then w(m)=0w(m+pc)=w(m+b)=0w(m)=0\implies w(m+p-c)=w(m+b)=0. If x=a=min(A)x=a=\min(A), then we note that for all m<am<a, w(m)=0w(m)=0. Therefore it suffices to check that for m[0,a1]m\in[0,a-1], we have wA(b+c+ma)=0w^{A}(b+c+m-a)=0. Simplify by substituting i=am[1,a]i=a-m\in[1,a]. ∎

This Corollary will likely help in proving Conjecture 3.

Corollary 2.12.2.

If A={1,b,c}A=\{1,b,c\}, then Per(A)(b+c)\operatorname{Per}(A)\mid(b+c) and PrePer(A)=0\operatorname{PrePer}(A)=0 if and only if wA(b+c1)=1w^{A}(b+c-1)=1. \square

These corollaries give some insight to the usefulness of the translating zeros Lemma. For Corollary 2.12.2 we can determine the period and preperiod by checking one value of the sequence! This will be used in Section 4.

Lemma 2.13.

The following statements are equivalent.

  1. (i)

    ww is periodic over pp with no preperiod

  2. (ii)

    For all n0n\geq 0, w(n)=w(n+p)w(n)=w(n+p)

  3. (iii)

    For all nαn\geq\alpha, v(n)=v(n+p)\vec{v}(n)=\vec{v}(n+p)

  4. (iv)

    v(α)=v(α+p)\vec{v}(\alpha)=\vec{v}(\alpha+p)

  5. (v)

    For all xAx\in A, for each m<xm<x, we have w(m)=0w(m+px)=1w(m)=0\implies w(m+p-x)=1. \square

3 The {a,b}\{a,b\} case

We first inspect the case when |A|=1|A|=1. If A={a}A=\{a\}, then the recurrence relation in Equation 1 gives that wA(n)=1wA(na)w^{A}(n)=1-w^{A}(n-a) for all nn\in\mathbb{N}. This gives us an immediate characterization of the periodicity for all possible seeds.

Proposition 3.1.

Let A={a}A=\{a\}. For all seeds SS, let S¯\overline{S} be the string exchanging 0’s and 11’s. Then {wA,S}=(S¯S)\{w^{A,S}\}=\big{(}\,\overline{S}\,S\,\big{)}^{\infty}, so Per(A,S)2a\operatorname{Per}(A,S)\mid 2a and PrePer(A,S)=0\operatorname{PrePer}(A,S)=0. \square

This gives the result that 𝒲{a}={(S¯S)S{0,1}a}}\mathcal{W}^{\{a\}}=\big{\{}(\,\overline{S}\,S\,\big{)}^{\infty}\mid S\in\{0,1\}^{a}\}\big{\}} and thus |𝒲{a}|=2a\left|\mathcal{W}^{\{a\}}\right|=2^{a}.

Proposition 3.2.

Let A={a}A=\{a\}, and let a=2kca=2^{k}c, where cc is odd. Then 𝒫A={2k+1d:dc}\mathcal{P}^{A}=\{2^{k+1}d:d\mid c\}. \square

Proof.

First, we show that p=Per(A,S)p=\operatorname{Per}(A,S) must be of the form 2k+1d2^{k+1}d. We know that {wA,S}\{w^{A,S}\} will always be periodic over 2a2a, so p2ap\mid 2a. Additionally, we know wA,S(n)wA,S(n+a)w^{A,S}(n)\neq w^{A,S}(n+a) for all nn, so p/ap\mid\!\!\!\!/\,\,a. Therefore 2k+1p2^{k+1}\mid p. We now show that for any dcd\mid c we have 2k+1d𝒫{a}2^{k+1}d\in\mathcal{P}^{\{a\}}. Because c/dc/d is odd let c=(2x+1)dc=(2x+1)d. Then let S=(12kd02kd)x12kdS=\left(1^{2^{k}d}0^{2^{k}d}\right)^{x}1^{2^{k}d}, so we conclude {wA,S}=((12kd02kd)x12kd(02kd12kd)x02kd)=(12kd02kd)\{w^{A,S}\}=\left(\left(1^{2^{k}d}0^{2^{k}d}\right)^{x}1^{2^{k}d}\ \left(0^{2^{k}d}1^{2^{k}d}\right)^{x}0^{2^{k}d}\right)^{\infty}=\left(1^{2^{k}d}0^{2^{k}d}\right)^{\infty} and Per({a},S)=2k+1d\operatorname{Per}(\{a\},S)=2^{k+1}d. ∎

These initial results are apparent at first inspection of the problem. With more work will get similarly general results for |A|=2|A|=2.

Theorem 3.3.

Let A={a,b}A=\{a,b\}. For all seeds SS, Per(A,S)a+b\operatorname{Per}(A,S)\mid a+b and PrePer(A,S)=0\operatorname{PrePer}(A,S)=0.

Proof.

Let A={a,b}A=\{a,b\}. For all nn\in\mathbb{N}, in the case where w(n)=0w(n)=0 we have w(n+a)=w(n+b)=1w(n+a)=w(n+b)=1, which implies that w(n+a+b)=0w(n+a+b)=0. Alternately, if w(n)=1w(n)=1, then w(na)=0w(n-a)=0 or w(nb)=0w(n-b)=0, so by the 0-case we know w(n+b)=0w(n+b)=0 or w(n+a)=0w(n+a)=0 respectively. This means w(n+a+b)=1w(n+a+b)=1. ∎

The following Theorem on 22-set games with no seed is well known and can be found in [4, p. 530].

Theorem 3.4.

Let A={a,b}A=\{a,b\} with a<ba<b, and let b=qa+rb=qa+r with 0r<a0\leq r<a. Then

{wA}={(0a1a)q/20r1aq is even.(0a1a)q/21rq is odd.=(0a1a0a1ab1a)\{w^{A}\}=\begin{cases}(0^{a}1^{a})^{q/2}0^{r}1^{a}&q\text{ is even.}\\ (0^{a}1^{a})^{\left\lceil q/2\right\rceil}1^{r}&q\text{ is odd.}\end{cases}\ =\Big{(}\underbrace{0^{a}1^{a}0^{a}1^{a}\ldots}_{b}1^{a}\Big{)}^{\infty} (8)

so Per(A)=2a\operatorname{Per}(A)=2a if bb is an odd multiple of aa and Per(A)=a+b\operatorname{Per}(A)=a+b otherwise.

Proof.

For n<bn<b, we note that by having no seed wA(nb)=1w^{A}(n-b)=1. This implies wA(n)=w{a}(n)w^{A}(n)=w^{\{a\}}(n). This yields the sequence {wA}=0a1a0a1ab\{w^{A}\}=\underbrace{0^{a}1^{a}0^{a}1^{a}\ldots}_{b} . For n[b,a+b)n\in[b,a+b), we note that nb[0,a)n-b\in[0,a) so wA(nb)=0w^{A}(n-b)=0 and thus wA(n)=1w^{A}(n)=1. Theorem 3.3 implies that this period repeats. ∎

3.1 A Preliminary Tool: Studying {1,b}\{1,b\}

Theorem 3.4 characterizes the period structure for the default seed. Our next goal is to describe the sequence under all seeds. One corollary of the following theorems is that for any a,ba,b coprime, 4,6𝒫{a,b}4,6\notin\mathcal{P}^{\{a,b\}}. At present, it seems like it should be possible to find a seed which generates a period of 44 or 66 as long as 4a+b4\mid a+b or 6a+b6\mid a+b, but in fact it is not. We will give a full characterization of all period structures and lengths which will make this fact obvious. To do this, we first analyze the special case where a=1a=1.

Theorem 3.5.

Suppose we have A={1,b}A=\{1,b\} and a string XX with no-subperiod. Then X𝒲AX^{\infty}\in\mathcal{W}^{A} if and only if |X||(1+b)|X|\Big{|}(1+b) and XX is some concatenation of 0101 and 011011 under some rotation.

Proof.

\implies Suppose that {wA,S}=X\{w^{A,S}\}=X^{\infty}. By the assumption that XX has no sub-period, Per(A)=|X|\operatorname{Per}(A)=|X|, so by Theorem 3.3 |X||(1+b)|X|\Big{|}(1+b). Next we will show that XX has no two consecutive 0’s or three consecutive 11’s. By the recurrence relation, w(n)=0w(n)=0 implies w(n+1)=1w(n+1)=1. Additionally, suppose for some sufficiently large nn that w(n)=w(n1)=1w(n)=w(n-1)=1 This implies w(nb)=0w(n-b)=0, so by Theorem 3.3 w(nb+b+1)=w(n+1)=0w(n-b+b+1)=w(n+1)=0. These two restrictions mean that XX is a concatenation of 0101 and 011011 under some rotation. \Longleftarrow Suppose that k|X|=(1+b)k|X|=(1+b) for k1k\geq 1 and XX is some concatenation of 0101 and 011011. For the seed SS we can simply choose XkX^{k}, so it suffices to show that XX^{\infty} satisfies the recurrence relation. Choose nn\in\mathbb{N}. First, suppose X(n1)=0X^{\infty}(n-1)=0. Because there are no consecutive 0’s, X(n)=1X^{\infty}(n)=1, which satisfies the recurrence relation. Now suppose X(n1)=1X^{\infty}(n-1)=1 and X(n+1)=0X^{\infty}(n+1)=0. Because there are no consecutive 0’s, X(n)=1X^{\infty}(n)=1. Additionally because XX^{\infty} is periodic over |X||X|, X(n+1k|X|)=X(nb)=0X^{\infty}(n+1-k|X|)=X^{\infty}(n-b)=0, so indeed X(n)=1X^{\infty}(n)=1 satisfies the recurrence. Now consider the last case X(n1)=X(n+1)=1X^{\infty}(n-1)=X^{\infty}(n+1)=1. Because there are no three consecutive 11’s, this implies X(n)=0X^{\infty}(n)=0. Additionally X(n+1k|X|)=X(nb)=1X^{\infty}(n+1-k|X|)=X^{\infty}(n-b)=1 and by assumption X(n1)=1X^{\infty}(n-1)=1, so X(n)=0X^{\infty}(n)=0 satisfies the recurrence. ∎

Recall from Theorem 3.3 that {wA,S}\{w^{A,S}\} can never have a preperiod, so Theorem 3.5 completely characterizes all possible sequences for {1,b}\{1,b\}. We also note that instead of considering strings XX with |X||(b+1)|X|\big{|}(b+1) and no subperiod, we can equivalently consider all XX with |X|=(b+1)|X|=(b+1) and allow for any subperiod of length p(b+1)p\mid(b+1). Define the sets

𝒬:={X{0,1},X is a concatenation of 01 and 011 under some rotation},\mathcal{Q}:=\{X\in\{0,1\}^{\ell}\mid\ell\in\mathbb{N},\ X\text{ is a concatenation of 01 and 011 under some rotation}\},

and 𝒬():={X𝒬|X|=}\mathcal{Q}(\ell):=\{X\in\mathcal{Q}\mid|X|=\ell\}. Sequences of this form can be generated iteratively by hand or by computer. For example, 𝒬(2)={01,10}\mathcal{Q}(2)=\{01,10\}, 𝒬(3)={011,101,110}\mathcal{Q}(3)=\{011,101,110\}, and 𝒬(6)={010101,101010,\mathcal{Q}(6)=\{010101,101010,
011011,101101,110110}011011,101101,110110\}. Theorem 3.5 proves that 𝒲{1,b}={XX𝒬(b+1)}\mathcal{W}^{\{1,b\}}=\{X^{\infty}\mid X\in\mathcal{Q}(b+1)\}. We can also provide an explicit enumeration of the possible sequences.

Theorem 3.6.

Let ϕ\phi be the plastic constant and z,z¯z,\bar{z} be the other two complex roots of x3x1x^{3}-x-1, and let Q():=ϕ+z+z¯Q(\ell):=\phi^{\ell}+z^{\ell}+{\bar{z}}^{\ell}. Then the number of distinct sequences {w{1,b},S}\{w^{\{1,b\},S}\} over all seeds SS is

|𝒲{1,b}|=|𝒬(1+b)|=Q(1+b).\big{|}\mathcal{W}^{\{1,b\}}\big{|}=\left\lvert\mathcal{Q}(1+b)\right\rvert=Q(1+b). (9)
Proof.

To find a recurrence relation, we consider the four possible forms for the period structure XX to take, and how each can be reduced to a different form. We will then add the sequences which count each of these forms.

Q1()\displaystyle Q_{1}(\ell) X=001\displaystyle X=0\ldots 01 Q1(2)+Q2(2)\displaystyle Q_{1}(\ell-2)+Q_{2}(\ell-2) by removing the last two numbers
Q2()\displaystyle Q_{2}(\ell) X=011\displaystyle X=0\ldots 11 Q1(1)\displaystyle Q_{1}(\ell-1) by removing the last number
Q3()\displaystyle Q_{3}(\ell) X=101\displaystyle X=1\ldots 01 Q2()\displaystyle Q_{2}(\ell) by rotating one character left
Q4()\displaystyle Q_{4}(\ell) X=110\displaystyle X=1\ldots 10 Q1()+Q2()\displaystyle Q_{1}(\ell)+Q_{2}(\ell) by rotating one character right
Q()=Q1()+Q2()+Q3()+Q4()=3Q2()+2Q1()=3Q1(1)+2Q1().Q(\ell)=Q_{1}(\ell)+Q_{2}(\ell)+Q_{3}(\ell)+Q_{4}(\ell)=3Q_{2}(\ell)+2Q_{1}(\ell)=3Q_{1}(\ell-1)+2Q_{1}(\ell).

We note Q1()=Q1(2)+Q1(3)Q_{1}(\ell)=Q_{1}(\ell-2)+Q_{1}(\ell-3), so to follows that Q()=Q(2)+Q(3)Q(\ell)=Q(\ell-2)+Q(\ell-3). This is a linear recurrence relation, meaning Q()Q(\ell) is a linear combination of the form c1ϕ+c2z+c3z¯c_{1}\phi^{\ell}+c_{2}z^{\ell}+c_{3}{\bar{z}}^{\ell}, where ϕ,\phi, zz, and z¯\bar{z} are the roots of x3x1x^{3}-x-1. We give initial conditions Q(1)=0Q(1)=0, Q(2)=|{01,10}|=2Q(2)=|\{01,10\}|=2, and Q(3)=|{011,101,011}|=3Q(3)=|\{011,101,011\}|=3.

To find the coefficients we compute that Q(0)=3Q(0)=3, so c1+c2+c3=3c_{1}+c_{2}+c_{3}=3. Additionally, QQ is real so c2=c3c_{2}=c_{3}. Finally, we know that x3x1=(xϕ)(xz)(xz¯)=x3(ϕ+z+z¯)x2+x^{3}-x-1=(x-\phi)(x-z)(x-\bar{z})=x^{3}-(\phi+z+\bar{z})x^{2}+\ldots, so ϕ+z+z¯=0=Q(1)\phi+z+\bar{z}=0=Q(1). Therefore c1=c2=c3=1c_{1}=c_{2}=c_{3}=1. ∎

Q()Q(\ell) is in the OEIS, known as the Perrin sequence [10, A001608].

3.1.1 Distinct Periodicities.

If we analyze 𝒲{1,5}\mathcal{W}^{\{1,5\}}, or equivalently 𝒬(6)\mathcal{Q}(6), we find that all of the sequences ‘look like’ some form of (01)(01)^{\infty} or (011)(011)^{\infty}, with some initial shift that we call a ‘rotation’. This is true for many sequences, motivating a formal notion of similarity between period structures.

Definition 5.

We call two strings X1,X2X_{1},X_{2} similar if they have a common subperiod, i.e. X1k1=X2k2X_{1}^{k_{1}}=X_{2}^{k_{2}} for k1,k21k_{1},k_{2}\geq 1, or if X2X_{2} is some rotation of X1X_{1}, i.e. |X1|=|X2|=|X_{1}|=|X_{2}|=\ell and X2(n)=X1(n+x(mod))X_{2}(n)=X_{1}(n+x\pmod{\ell}). We define \simeq to be the equivalence relation generated by these two criteria. We say XX and YY are distinct if X≄YX\not\simeq Y.

Definition 6.

We denote 𝒬/\mathcal{Q}/\!\simeq as the set of equivalence classes of 𝒬\mathcal{Q} under \simeq. The length of a class [Y][Y] is the length of its smallest element, i.e. the smallest subperiod of YY or the period length of YY^{\infty}.

Recall that 𝒬()\mathcal{Q}(\ell) is the set of all strings in 𝒬\mathcal{Q} with length \ell, which is in bijection with 𝒲{1,1}\mathcal{W}^{\{1,\ell-1\}}. Therefore 𝒬()/\mathcal{Q}(\ell)/\simeq is the set of distinct periodicites in 𝒬()\mathcal{Q}(\ell), so

𝒲{1,b}/={X,[X]𝒬()/}\mathcal{W}^{\{1,b\}}/\!\simeq\ \ \ =\ \ \big{\{}X^{\infty},[X]\in\mathcal{Q}(\ell)/\simeq\big{\}} (10)
Definition 7.

We define (𝒬/)()(\mathcal{Q}/\!\simeq)(\ell) to be set of distinct periodicities of 𝒬/\mathcal{Q}/\!\simeq with length \ell. Similarly (𝒲A/)()(\mathcal{W}^{A}/\!\simeq)(\ell) is the set of distinct periodicites in 𝒲A/\mathcal{W}^{A}/\!\simeq with length \ell.

It follows that

(𝒲{1,b}/)()={X,[X](Q/)()}.(\mathcal{W}^{\{1,b\}}/\!\simeq)(\ell)\ \ \ =\ \ \big{\{}X^{\infty},[X]\in\mathcal{(}Q/\simeq)(\ell)\big{\}}. (11)

This implies that p𝒫{1,b}p\in\mathcal{P}^{\{1,b\}} if and only if p(1+b)p\mid(1+b) and |(𝒬/)(p)|>0\left\lvert(\mathcal{Q}/\!\simeq)(p)\right\rvert>0, as means there is some non-periodic string X𝒬X\in\mathcal{Q} with length |X|=p|X|=p and thus X(𝒲{1,b}/)(p)X^{\infty}\in(\mathcal{W}^{\{1,b\}}/\!\simeq)(p).

Example 3.7.

If we want to find the distinct periodicities of length three, six, and eight, we observe that (𝒬/)(3)={[011]}(\mathcal{Q}/\!\simeq)(3)=\{[011]\}, (𝒬/)(6)=(\mathcal{Q}/\!\simeq)(6)=\emptyset, and (𝒬/)(8)={[01101101]}(\mathcal{Q}/\!\simeq)(8)=\{[01101101]\}. In contrast, if we wish to know all distinct periodicites of {1,2}\{1,2\}, {1,5}\{1,5\}, and {1,7}\{1,7\}, we instead consult (𝒬(3)/)={[011]}(\mathcal{Q}(3)/\!\simeq)=\{[011]\}, (𝒬(6)/)={[(01)3],[(011)2]}(\mathcal{Q}(6)/\!\simeq)=\{[(01)^{3}],[(011)^{2}]\}, and (𝒬(8)/)={[(01)4],[01101101]}(\mathcal{Q}(8)/\!\simeq)=\{[(01)^{4}],[01101101]\}.

It follows that because the periodicites of 𝒬()\mathcal{Q}(\ell) must have some length dd\mid\ell, we can enumerate 𝒬()/\mathcal{Q}(\ell)/\simeq by partitioning over period length. The following is a natural result of Equations 10 and 11.

|𝒲{1,1}/|=d|(𝒲{1,1}/)(d)|=|𝒬()/|=d|(𝒬/)(d)||\mathcal{W}^{\{1,\ell-1\}}/\simeq|=\sum_{d\mid\ell}|(\mathcal{W}^{\{1,\ell-1\}}/\simeq)(d)|\hskip 20.0pt=\hskip 20.0pt|\mathcal{Q}(\ell)/\simeq|=\sum_{d\mid\ell}|(\mathcal{Q}/\simeq)(d)| (12)

In the rest of this section we will enumerate the sets 𝒲{a,b}\mathcal{W}^{\{a,b\}}, 𝒲{a,b}/\mathcal{W}^{\{a,b\}}/\!\simeq, and (𝒲{a,b}/)()(\mathcal{W}^{\{a,b\}}/\!\simeq)(\ell) for all {a,b}\{a,b\}. Recall that Theorem 3.6 gives |𝒲{1,b}|=Q(n)|\mathcal{W}^{\{1,b\}}|=Q(n).

Proposition 3.8.

Define

N():=Q()d!|dN(d)N(L):=LN(),N^{\prime}(\ell):=\frac{\displaystyle Q(\ell)-\sum_{d!|\ell}d\cdot N^{\prime}(d)}{\ell}\hskip 30.0ptN(L):=\sum_{\ell\mid L}N^{\prime}(\ell), (13)

where d!|d!|\ell represents proper divisors of \ell. Then the number of distinct periodicities of {1,b}\{1,b\} of length (1+b)\ell\mid(1+b) is |(𝒲{1,b}/)()|=N()|(\mathcal{W}^{\{1,b\}}/\!\simeq)(\ell)|=N^{\prime}(\ell), and the total number of distinct perioditicites is |𝒲{1,b}/|=N(b+1)|\mathcal{W}^{\{1,b\}}/\!\simeq|=N(b+1).

Proof.

We will show N()=|(𝒬/)()|N^{\prime}(\ell)=|(\mathcal{Q}/\simeq)(\ell)|. First we consider all strings X𝒬()X\in\mathcal{Q}(\ell). In particular suppose XX has period pp, so /p=k\ell/p=k and X=ZkX=Z^{k} for some ZZ having no subperiod, i.e. [Z](𝒬/)(p)[Z]\in(\mathcal{Q}/\simeq)(p). Because ZZ has no subperiod, it has pp different rotations and therefore pp representatives X1,,Xp𝒬()X_{1},\ldots,X_{p}\in\mathcal{Q}(\ell). Since pp can be any divisor of \ell, we conclude |𝒬()|=pp|(𝒬/)(p)||\mathcal{Q}(\ell)|=\sum_{p\mid\ell}p|(\mathcal{Q}/\simeq)(p)|/ We can rearrange this to conclude |(𝒲{1,b}/)()|=|(𝒬/)()|=N()|(\mathcal{W}^{\{1,b\}}/\!\simeq)(\ell)|=|(\mathcal{Q}/\simeq)(\ell)|=N^{\prime}(\ell) as written in Equation 13. Note that we do not need a base case to compute NN^{\prime} explicitly because 11 has no proper divisors. Equation 12 implies |𝒲{1,b}/|=N(b+1)|\mathcal{W}^{\{1,b\}}/\!\simeq|=N(b+1). ∎

Note that N()N^{\prime}(\ell) does not depend on bb, and in fact the set of distinct periodicities of length \ell is equal for any bb as long as (1+b)\ell\mid(1+b). The OEIS contains sequences N()N^{\prime}(\ell) [10, A113788] and N(L)N(L) [10, A127687], motivating an interesting bijection.

It is known that Q()Q(\ell) counts the maximal independent sets in vertex labeled cycles CC_{\ell} (see, for example, Example 1.2 in [7]). In 2007, Bisdorff et. al demonstrated that N(b+1)N(b+1) counts the number of unlabeled maximal independent sets of the cycle Cb+1C_{b+1} [5]. The correspondence between a binary sequence YY and a vertex set SV(Cb+1)S\subseteq V(C_{b+1}) is simple; we include the ithi^{\text{th}} vertex in SS exactly when Y(i)=0Y(i)=0. For example 𝒬(10)(01)2(011)2{1,3,5,8}V(C10)\mathcal{Q}(10)\ni(01)^{2}(011)^{2}\mapsto\{1,3,5,8\}\subseteq V(C_{10}). The conditions for a string to be valid are equivalent to those for a maximal independent set. We cannot have two adjacent vertices of SS by independence, and YY cannot have two consecutive zeros by Theorem 3.5. We also cannot have three adjacent non-vertices in SS by maximality, or else we could add the middle vertex to SS. Similarly YY cannot have three consecutive ones. By our construction, it is clear that NN counts these sets in Cb+1C_{b+1} up to rotation, but not reflection. For example, the sequence (01)(011)(01)2(011)(01)3(011)≄(01)3(011)(01)2(011)(01)(011)(01)(011)(01)^{2}(011)(01)^{3}(011)\not\simeq(01)^{3}(011)(01)^{2}(011)(01)(011) because one cannot be rotated to the other, so they belong to different equivalence classes of 𝒬/\mathcal{Q}/\simeq. Thus, N(21)N(21) will count them both. However a reflection automorphism of C21C_{21} would map the corresponding independent sets to each other. Moving forward, Table 1 shows the sequences Q()Q(\ell), N()N^{\prime}(\ell), and N()N(\ell) for {0,,20}\ell\in\{0,\ldots,20\}.

3.2 Generalizing to {a,b}\{a,b\}

We will use a simple multiplicative permutation of wA,Sw^{A,S} to reduce every {a,b}\{a,b\} case to a version of {1,b}\{1,b^{\prime}\}. This will induce the strict structure of Theorem 3.5 on the seemingly complex periodicities of the {a,b}\{a,b\} case. We will generally assume that a,ba,b are coprime. If not, we can divide out g=gcd(a,b)g=\gcd(a,b) and then find gg parallel copies of sequences (w)i(w)_{i} for the coprime set A={a/g,b/g}A=\{a/g,b/g\} using Multiplicative Linearity Proposition 2.7.

Definition 8.

Given some a,ba,b coprime, define the permutation σa,a+b:{0,1}a+b{0,1}a+b\sigma_{a,a+b}:\{0,1\}^{a+b}\mathrel{\mathrlap{\hookrightarrow}}\mathrel{\mkern 2.0mu\twoheadrightarrow}\{0,1\}^{a+b} by σa,a+b(Y)=X\sigma_{a,a+b}(Y)=X, where X(n)=Y(an(moda+b))X(n)=Y(an\pmod{a+b}) for all n{0,a+b1}n\in\{0,\ldots a+b-1\}.

Because aa and a+ba+b are coprime, σa,a+b(Y)\sigma_{a,a+b}(Y) is a permutation of the string YY for all Y{0,1}a+bY\in\{0,1\}^{a+b}. This means σa,a+b\sigma_{a,a+b} is invertable, so it is a permutation of the collection {0,1}a+b\{0,1\}^{a+b}.

Theorem 3.9 (Bijection).

Suppose A={a,b}A=\{a,b\} with a,ba,b coprime and let A={1,a+b1}A^{\prime}=\{1,a+b-1\}. For any string YY with |Y|=a+b|Y|=a+b, let X=σa,a+b(Y)X=\sigma_{a,a+b}(Y). Then Y𝒲AY^{\infty}\in\mathcal{W}^{A} if and only if X𝒲AX^{\infty}\in\mathcal{W}^{A^{\prime}}.

Proof.

It suffices to show that YY^{\infty} obeys the recurrence relation if and only if XX^{\infty} does, as we could then use the seeds Y(a+b)/|Y|Y^{(a+b)/|Y|} and X(a+b)/|X|X^{(a+b)/|X|} respectively. Let a-1a^{\text{-}1} be the multiplicative inverse of a(moda+b)a\pmod{a+b}. This means Y(n)=X(a-1n(moda+b))Y^{\infty}(n)=X^{\infty}(a^{\text{-}1}n\pmod{a+b}), so Y=σa-1,a+b(X)Y=\sigma_{a^{\text{-}1},a+b}(X). By leveraging the periodicity of YY^{\infty} and XX^{\infty} over a+ba+b, and noting that ba(moda+b)b\equiv-a\pmod{a+b}, we get

Y(n)\displaystyle Y^{\infty}(n) =X(a-1n)\displaystyle=X^{\infty}(a^{\text{-}1}n)
Y(na)\displaystyle Y^{\infty}(n-a) =X(a-1na-1a)\displaystyle=X^{\infty}(a^{\text{-}1}n-a^{\text{-}1}a) =X(a-1n1)\displaystyle=X^{\infty}(a^{\text{-}1}n-1)
Y(nb)\displaystyle Y^{\infty}(n-b) =X(a-1na-1(a))=X(a-1n+1)\displaystyle=X^{\infty}(a^{\text{-}1}n-a^{\text{-}1}(-a))=X^{\infty}(a^{\text{-}1}n+1) =X(a-1n(a+b1))\displaystyle=X^{\infty}(a^{\text{-}1}n-(a+b-1))

Therefore YY^{\infty} follows the recurrence relation of A={a,b}A=\{a,b\} if and only if XX^{\infty} follows the recurrence relation of A={1,a+b1}A^{\prime}=\{1,a+b-1\}. ∎

Theorem 3.9 implies that the set of all period structures of {a,b}\{a,b\} can be obtained by applying the inverse permutation σa,a+b-1=σa-1,a+b\sigma_{a,a+b}^{\text{-}1}=\sigma_{a^{\text{-}1},a+b} to each period structure of {1,a+b1}\{1,a+b-1\}. Because σa,a+b\sigma_{a,a+b} is a permutation of {0,1}a+b\{0,1\}^{a+b}, it bijects the set 𝒲{a,b}\mathcal{W}^{\{a,b\}} of all {w{a,b},S}\{w^{\{a,b\},S}\} sequences with the set 𝒲{1,a+b1}\mathcal{W}^{\{1,a+b-1\}}. In particular, we conclude precisely that if aa and bb are coprime, then

𝒲{a,b}={YY=σa-1,a+b(X),X𝒬(a+b)},\mathcal{W}^{\{a,b\}}=\{Y^{\infty}\mid Y=\sigma_{a^{\text{-}1},a+b}(X),\ X\in\mathcal{Q}(a+b)\}, (14)

or informally 𝒲{a,b}=σa-1,a+b[𝒲{1,a+b1}]\mathcal{W}^{\{a,b\}}=\sigma_{a^{\text{-}1},a+b}\left[\mathcal{W}^{\{1,a+b-1\}}\right]. Therefore Theorem 3.9 implies that we can generalize the results of Section 3.1.

Corollary 3.9.1.

Choose any A={a,b}={a~g,b~g}A=\{a,b\}=\{\tilde{a}g,\tilde{b}g\}, where g=gcd(a,b)g=\gcd(a,b). Then |𝒲A|=(Q(a~+b~))g|\mathcal{W}^{A}|=(Q(\tilde{a}+\tilde{b}))^{g}. \square

The power of gg follows from Linearity Proposition 2.7. Each of the independent parallel sequences (wA,S)i(m)(w^{A,S})_{i}(m) for i{0,,g1}i\in\{0,\ldots,g-1\} is equal to some {a~,b~}\{\tilde{a},\tilde{b}\} game. Thus we can count gg-tuples of strings in σa~-1,a~+b~[𝒬(a+b)]\sigma_{\tilde{a}^{\text{-}1},\tilde{a}+\tilde{b}}\left[\mathcal{Q}(a+b)\right] to arrive at the total, which we formalize in Theorem 3.10. Next, we find that σa,a+b\sigma_{a,a+b} also bijects the classes of distinct periods.

Corollary 3.9.2.

Let a,ba,b be coprime and A={a,b}A=\{a,b\}. Then |𝒲A/()|=N()|\mathcal{W}^{A}/\!\simeq(\ell)|=N^{\prime}(\ell) is the number of distinct periodicities of length (a+b)\ell\mid(a+b), and |𝒲A/|=N(a+b)|\mathcal{W}^{A}/\!\simeq|=N(a+b) is the total number of distinct periodicities of AA.

Proof.

It suffices to show that σa,a+b\sigma_{a,a+b} preserves rotational symmetries and subperiods. Suppose some sequences YY and YY^{\prime} are rotated copies of each other, i.e. there is some rr such that Y(n)=Y(n+r(mod))Y(n)=Y^{\prime}(n+r\pmod{\ell}) for all nn. This implies (σY)(n)=(σY)(n+ar(mod))(\sigma Y)(n)=(\sigma Y^{\prime})(n+ar\pmod{\ell}), so σY\sigma Y and σY\sigma Y^{\prime} are rotated copies of each other with shift arar. Additionally, suppose YY has some subperiod, i.e. there is some r0(mod)r\not\equiv 0\pmod{\ell} such that Y(n)=Y(n+r(mod))Y(n)=Y(n+r\pmod{\ell}). This implies YY is a rotated copy of itself, so indeed σY\sigma Y is a rotated copy of itself with shift ar0(mod)ar\not\equiv 0\pmod{\ell}, since (a+b)\ell\mid(a+b) and gcd(a,a+b)=1\gcd(a,a+b)=1. We conclude that for all XX and YY, XYX\simeq Y if and only if σXσY\sigma X\simeq\sigma Y, so equivalence classes of \simeq are bijected by σa,a+b\sigma_{a,a+b}. ∎

If aa and bb are not coprime, it is more complicated to count the number of distinct periodicities, but we can use a generalization of Proposition 3.8.

Theorem 3.10.

Choose any A={a,b}={a~g,b~g}A=\{a,b\}=\{\tilde{a}g,\tilde{b}g\}, where g=gcd(a,b)g=\gcd(a,b). Define the following functions for all g,{0}g,\ell\in\mathbb{N}\setminus\{0\} and L=gL=g\ell:

N(L,g):=Q()gd!|LdN(d,gcd(d,g))LN(L,g):=pLN(p,gcd(p,g))N^{\prime}(L,g):=\frac{\displaystyle Q(\ell)^{g}-\sum_{d!|L}d\cdot N^{\prime}\left(d,\gcd(d,g)\right)}{L}\hskip 30.0ptN(L,g):=\sum_{p\mid L}N^{\prime}(p,\gcd(p,g)) (15)

Then |𝒲A/(p)|=N(p,gcd(p,a,b))|\mathcal{W}^{A}/\!\simeq(p)|=N^{\prime}(p,\gcd(p,a,b)) is the number of distinct periodicities of AA with length pp, and |𝒲A/|=N(a+b,g)|\mathcal{W}^{A}/\!\simeq|=N(a+b,g) is the total number of distinct periodicities of AA.

Proof.

First we will justify that the total number of strings in 𝒲{a,b}\mathcal{W}^{\{a,b\}} which are periodic over pp is (Q(pgcd(p,g)))gcd(p,g)\left(Q(\frac{p}{\gcd(p,g)})\right)^{\gcd(p,g)}, not considering similarity under \simeq. Denote this set by 𝒲{a,b}(p)\mathcal{W}^{\{a,b\}}(p). Let =a~+b~\ell=\tilde{a}+\tilde{b}. We know by Theorem 3.3 that {w}\{w\} is always periodic over g=a+bg\ell=a+b, so for all SS, {wA,S}=Y\{w^{A,S}\}=Y^{\infty} for some YY with |Y|=g|Y|=g\ell. Using Linearity Proposition 2.7, we can write YY as a collection of parallel strings YiY_{i} for i{0,g1}i\in\{0,\ldots g-1\} where |Yi|=|Y_{i}|=\ell, and for all m{0,,1}m\in\{0,\ldots,\ell-1\}, Yi(m)=Y(gm+i)Y_{i}(m)=Y(gm+i). Additionally, for each ii, YiY_{i}^{\infty} must satisfy the recurrence relation for {a~,b~}\{\tilde{a},\tilde{b}\}. Suppose that YY is also periodic over length pp\mid\ell, so Y𝒲{a,b}(p)Y^{\infty}\in\mathcal{W}^{\{a,b\}}(p). Using the division algorithm let p=xg+rp=xg+r, where r<gr<g and xx\in\mathbb{N}. Additionally, let γ=gcd(p,g)\gamma=\gcd(p,g) and g~=g/γ\tilde{g}=g/\gamma. We will prove that the following conditions are sufficient and necessary for this to occur.

  1. (i)

    For all i{0,,γ1}i\in\{0,\ldots,\gamma-1\}, and all mm,  Yi(m)=Yi(m+p/γ)\displaystyle{Y_{i}(m)=Y_{i}(m+p/\gamma)}

  2. (ii)

    For all i{γ,,g1}i\in\{\gamma,\ldots,g-1\} and all mm,  Yi(m)={Yir(mx)irYir+g(mx1)i<r\displaystyle{Y_{i}(m)=\begin{cases}Y_{i-r}(m-x)&i\geq r\\ Y_{i-r+g}(m-x-1)&i<r\\ \end{cases}}

We first show necessity. Assuming YY is periodic over length pp, this means for all m,im,i, we have

Yi(m)=Y(mg+i)\displaystyle Y_{i}(m)=Y(mg+i) =Y(mg+ip)=Y(mg+ixgr)={Yir(mx)irYir+g(mx1)i<r\displaystyle=Y(mg+i-p)=Y(mg+i-xg-r)=\begin{cases}Y_{i-r}(m-x)&i\geq r\\ Y_{i-r+g}(m-x-1)&i<r\\ \end{cases}
=Y(mg+i+g~p)=Y(mg+i+gp/γ)=Yi(m+p/γ),\displaystyle=Y(mg+i+\tilde{g}p)=Y(mg+i+gp/\gamma)=Y_{i}(m+p/\gamma),

This proves stronger versions of (i) and (ii).

Next, we show sufficiency. Assume (i) and (ii) hold. For any nn, use the division algorithm to get n=mg+in=mg+i. We hope to show that Y(n)=Y(np)Y(n)=Y(n-p). Suppose that i{γ,,g1}i\in\{\gamma,\ldots,g-1\}. Then by condition (ii),

Y(n)=Yi(m)={Yir(mx)irYir+g(mx1)i<r=Y(mggx+irgx)=Y(np)Y(n)=Y_{i}(m)=\begin{cases}Y_{i-r}(m-x)&i\geq r\\ Y_{i-r+g}(m-x-1)&i<r\\ \end{cases}=Y(mg-gx+i-r-gx)=Y(n-p) (16)

Alternately, suppose that i{0,,γ1}i\in\{0,\ldots,\gamma-1\}, and consider the set of indices i,i+r,i+2r,,i+(g~1)ri,i+r,i+2r,\ldots,i+(\tilde{g}-1)r, taken modulo gg. We denote these Iji+rj(modg)I_{j}\equiv i+rj\pmod{g} for j{0,,g~1}j\in\{0,\ldots,\tilde{g}-1\}. Because γr\gamma\mid r, this means Iji(modγ)I_{j}\equiv i\pmod{\gamma} for all jj. Additionally, we know that the order of rr in the group g+\mathbb{Z}_{g}^{+} is g/gcd(g,r)=g~g/\gcd(g,r)=\tilde{g}, which means that IjiI_{j}\neq i for j{1,,g~1}j\in\{1,\ldots,\tilde{g}-1\}. This means that only I0I_{0} can be in the set {0,,γ1}\{0,\ldots,\gamma-1\} and for all j>0j>0 we must have Ij{γ,,g1}I_{j}\in\{\gamma,\ldots,g-1\}.

Now, let n=ng~pn^{\prime}=n-\tilde{g}p, and consider the sequence of values Y(n),Y(n+p),,Y(n+(g~1)p)Y(n^{\prime}),Y(n^{\prime}+p),\ldots,Y(n^{\prime}+(\tilde{g}-1)p). We know that Y(n)=Yi(mp/γ)=Yi(m)=Y(n)Y(n^{\prime})=Y_{i}(m-p/\gamma)=Y_{i}(m)=Y(n) by condition (i). We also observe that for all j{0,,g~1}j\in\{0,\ldots,\tilde{g}-1\}, we have Y(n+pj)=YIj(mj)Y(n^{\prime}+pj)=Y_{I_{j}}(m_{j}) for some mjm_{j}. Because we know Ij{γ,,g1}I_{j}\in\{\gamma,\ldots,g-1\}, Equation 16 implies that Y(n+pj)=Y(n+p(j1))Y(n^{\prime}+pj)=Y(n^{\prime}+p(j-1)). Therefore

Y(n)=Y(n)=Y(n+p)==Y(n+(g~1)p)=Y(np).Y(n)=Y(n^{\prime})=Y(n^{\prime}+p)=\ldots=Y(n^{\prime}+(\tilde{g}-1)p)=Y(n-p).

Therefore we have shown that conditions (i) and (ii) are equivalent to YY^{\infty} being periodic over length pp, and we now enumerate the strings satisfying these conditions. To satisfy (i) we may choose any γ\gamma-tuple of sequences in 𝒲{a~,b~}\mathcal{W}^{\{\tilde{a},\tilde{b}\}} which are periodic over p/γp/\gamma for Y0,,Yγ1Y_{0},\ldots,Y_{\gamma-1}. To satisfy (ii) we must let Yγ,,Yg1Y_{\gamma},\ldots,Y_{g-1} be the appropriate translations of these sequences, so they are fixed. Thus we find the total number of possibilities |𝒲{a,b}(p)|=(Q(p/γ))γ\left\lvert\mathcal{W}^{\{a,b\}}(p)\right\rvert=(Q(p/\gamma))^{\gamma}.

An argument similar to Proposition 3.8 shows that |𝒲{a,b}(p)|=dpd|𝒲A/(d)|\left\lvert\mathcal{W}^{\{a,b\}}(p)\right\rvert=\sum_{d\mid p}d\left\lvert\mathcal{W}^{A}/\!\simeq(d)\right\rvert. Letting
N(d,gcd(d,g))=|𝒲A/(d)|N^{\prime}(d,\gcd(d,g))=\left\lvert\mathcal{W}^{A}/\!\simeq(d)\right\rvert, these can be rearranged to Equation 15. Note that we can also derive N(p,1)=N(p)N^{\prime}(p,1)=N^{\prime}(p) for all pp, meaning that if g=1g=1, we have reduced to the case of {a,b}\{a,b\} coprime. ∎

\ell 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Q()Q(\ell) 0 2 3 2 5 5 7 10 12 17 22 29 39 51 68 90 119 158 209 277
N()N^{\prime}(\ell) 0 1 1 0 1 0 1 1 1 1 2 2 3 3 4 5 7 8 11 13
N()N(\ell) 0 1 1 1 1 2 1 2 2 3 2 4 3 5 6 7 7 11 11 16
Table 1: Q()Q(\ell) counts the possible sequences {wA,S}\{w^{A,S}\} over all SS for A={a,b}A=\{a,b\} if a,ba,b coprime and a+b=a+b=\ell. N()N^{\prime}(\ell) counts the number of distinct periodicities of length \ell. N()N(\ell) counts the number of distinct periodicities of any length for A={a,b}A=\{a,b\}.

In the simpler case when a,ba,b are coprime, refer to the sequences Q(),N(),Q(\ell),N^{\prime}(\ell), and N()N(\ell) in Table 1. As a result of the general enumeration we find that for all gLg\mid L, N(L,g)=0N(L,g)=0 exactly when L=gL=g or L=4gL=4g or (L,g)=(6,1)(L,g)=(6,1). Thus

𝒫{a,b}={p|p|(a+b),pgcd(a,b),p4gcd(p,a,b),(p,gcd(p,a,b))(6,1)}\mathcal{P}^{\{a,b\}}=\Big{\{}p\ \Big{|}\ p|(a+b),\ p\not|\gcd(a,b),\ p\neq 4\gcd(p,a,b),\ (p,\gcd(p,a,b))\neq(6,1)\Big{\}}

We also see that for any coprime a,ba,b and any 10\ell\leq 10, there is at most one distinct periodicity of aa and bb of length \ell over all SS. Given some A={1,11k1}A=\{1,11k-1\} for k1k\geq 1, the two periodicites of length 1111 are (𝒬/)(11)={[(01)4(011)],[(01)(011)3]}\mathcal{(}\mathcal{Q}/\!\simeq)(11)=\big{\{}\big{[}(01)^{4}(011)\big{]},\,\big{[}(01)(011)^{3}\big{]}\big{\}}. This means that for any {a,b}\{a,b\}, with 11a+b11\mid a+b, the two periodicities are σa-1,11((01)4(011))\sigma_{a^{\text{-}1},11}\big{(}(01)^{4}(011)\big{)} and σa-1,11((01)(011)3)\sigma_{a^{\text{-}1},11}\big{(}(01)(011)^{3}\big{)}.

Example 3.11.

Consider the set A={3,11}A=\{3,11\}. There are N(14)=5N(14)=5 periodicites, where exactly N(14)=3N^{\prime}(14)=3 have period 1414. First we write the 5 periodicities of B={1,13}B=\{1,13\}, given by

𝒬(14)/={[(01)(011)4],[(01)4(011)2],[(01)3(011)(01)1(011)],[((01)2(011))2],[(01)7]}.\mathcal{Q}(14)/\simeq=\Big{\{}\left[(01)(011)^{4}\right],\ \left[(01)^{4}(011)^{2}\right],\ \left[(01)^{3}(011)(01)^{1}(011)\right],\ \left[((01)^{2}(011))^{2}\right],\ \left[(01)^{7}\right]\Big{\}}.

Next, we permute these strings. 3-15(mod14)3^{\text{-}1}\equiv 5\pmod{14}, so we compute Y=σ5,14(X)Y=\sigma_{5,14}(X). For the first string:

nn 𝟎\mathbf{0} 𝟏\mathbf{1} 𝟐\mathbf{2} 𝟑\mathbf{3} 𝟒\mathbf{4} 55 66 77 88 99 1010 1111 1212 1313
XX 𝟎\mathbf{0} 𝟏\mathbf{1} 𝟎\mathbf{0} 𝟏\mathbf{1} 𝟏\mathbf{1} 0 11 11 0 11 11 0 11 11
σ(X)\sigma(X) 𝟎\mathbf{0} 0 11 𝟏\mathbf{1} 11 0 𝟎\mathbf{0} 11 11 𝟏\mathbf{1} 0 11 𝟏\mathbf{1} 11
5n(mod14)5n\pmod{14} 𝟎\mathbf{0} 55 1010 𝟏\mathbf{1} 66 1111 𝟐\mathbf{2} 77 1212 𝟑\mathbf{3} 88 1313 𝟒\mathbf{4} 99

This yields σ5,14(01(011)4)=(0213)2(013)\sigma_{5,14}\big{(}01(011)^{4}\big{)}=(0^{2}1^{3})^{2}(01^{3}). Repeating this procedure, we get the following:

σ5,14(01(011)4)\displaystyle\sigma_{5,14}\big{(}01(011)^{4}\big{)} =\displaystyle= =(0213)2(013)\displaystyle=(0^{2}1^{3})^{2}(01^{3})
σ5,14((01)4(011)2)\displaystyle\sigma_{5,14}\big{(}(01)^{4}(011)^{2}\big{)} =0130313(01)2\displaystyle=01^{3}0^{3}1^{3}(01)^{2} 120313(01)3\displaystyle\simeq 1^{2}0^{3}1^{3}(01)^{3}
σ5,14((01)1011(01)3011)\displaystyle\sigma_{5,14}\big{(}(01)^{1}011(01)^{3}011\big{)} =021303150\displaystyle=0^{2}1^{3}0^{3}1^{5}0 03130315\displaystyle\simeq 0^{3}1^{3}0^{3}1^{5}
σ5,14((01)2011)2)\displaystyle\sigma_{5,14}\big{(}(01)^{2}011)^{2}\big{)} =014031402\displaystyle=01^{4}0^{3}1^{4}0^{2} (0314)2\displaystyle\simeq(0^{3}1^{4})^{2}
σ5,14((01)7)\displaystyle\sigma_{5,14}\big{(}(01)^{7}\big{)} =\displaystyle= =(01)7\displaystyle=(01)^{7}
𝒲{3,11}/={[((0213)2(013))],[( 120313(01)3)],[( 03130315)],[(0314)],[(01)]}\mathcal{W}^{\{3,11\}}\!/\!\simeq\ \ =\Big{\{}\left[\big{(}\,(0^{2}1^{3})^{2}(01^{3})\,\big{)}^{\infty}\right],\left[\big{(}\,1^{2}0^{3}1^{3}(01)^{3}\,\big{)}^{\infty}\right],\left[\big{(}\,0^{3}1^{3}0^{3}1^{5}\,\big{)}^{\infty}\right],\left[(0^{3}1^{4})^{\infty}\right],\left[(01)^{\infty}\right]\Big{\}}

Note that the period lengths of 22, 77, and 1414 are conserved under the permutation, as shown in Corollary 3.9.2. This procedure yields all 5 periodicites of {3,11}\{3,11\}.

The asympotic behavior of these functions is generally well behaved. Because |z|=|z¯|<1|z|=|\bar{z}|<1, where zz and z¯\bar{z} are the non-real roots of x3x1x^{3}-x-1, we have the convergence Q()=ϕ+z+z¯ϕQ(\ell)=\phi^{\ell}+z^{\ell}+{\bar{z}}^{\ell}\underset{{}^{\ell\to\infty}}{\to}\phi^{\ell}.333For all 10\ell\geq 10, we have the exact equality Q()=round(ϕ)Q(\ell)=\text{round}(\phi^{\ell}). For the following analysis, let A={a,b}=g{a~,b~}A=\{a,b\}=g\{\tilde{a},\tilde{b}\} with g=gcd(a,b)g=\gcd(a,b), and assume that a~+b~2.37lng\tilde{a}+\tilde{b}\geq 2.37\ln g, which excludes relatively few sets. Then |𝒲{a,b}|=Q(a~+b~)gϕa+b\left\lvert\mathcal{W}^{\{a,b\}}\right\rvert=Q(\tilde{a}+\tilde{b})^{g}\sim\phi^{a+b}. The set of seeds {SS{0,1}b}\{S\mid S\in\{0,1\}^{b}\} has cardinality 2b2a+b2^{b}\geq\sqrt{2}^{a+b}. Because ϕ1.32<2\phi\approx 1.32<\sqrt{2} this means that the set of seeds grows faster than the sequences they generate, the number of seeds converging to the same sequence {w}\{w\} grows exponentially as a+ba+b increases. This approximation of Q()Q(\ell) also implies that N()ϕ/N^{\prime}(\ell)\sim\phi^{\ell}/\ell and N()N()N(\ell)\sim N(\ell). We can can also derive ϕL/LN(L,g)N(L,g)\phi^{L}/L\sim N^{\prime}(L,g)\sim N(L,g), giving a strong estimation of the of the number of possible period structures for large a,ba,b.

4 The {1,b,c}\{1,b,c\} case

Analogously to Section 3.1, a good starting point for understanding the {a,b,c}\{a,b,c\} game is the {1,b,c}\{1,b,c\} game. This case was studied by Ho in [9, sec. 2], where he solves the game for c<4bc<4b. We provide a full analysis by constructing {w{1,b,c}}\{w^{\{1,b,c\}}\} for all bb and cc with no seed, where most importantly we specify the existence and structure of preperiods.

For the remainder of the paper we will use x:y(modz)x:\equiv y\pmod{z} to define xx as the least non negative remainder of yy modulo zz.

Theorem 4.1.

Suppose we have some 1<b<c1<b<c, and let A={1,b,c}A=\{1,b,c\}. Denote q:=c/(b+1)q:=\left\lfloor c/(b+1)\right\rfloor, r:c(modb+1)r:\equiv c\pmod{b+1}. This means c=q(b+1)+rc=q(b+1)+r. Additionally let k:=b/2k:=b/2 and γ:=br22\gamma:=\frac{b-r-2}{2}; we will only use these when they take on integer values.

Case Conditions Per(A)\operatorname{Per}(A) PrePer(A)\operatorname{PrePer}(A) {wA}\{w^{A}\}
i b,cb,c odd, 22 0 [01]\left[01\right]^{\infty}
ii bb odd, cc even, b+cb+c 0 [(01)c/21b]\left[(01)^{c/2}1^{b}\right]^{\infty}
iii bb even, c=b+1c=b+1 2b2b 0 [(01)k1b]\left[(01)^{k}1^{b}\right]^{\infty}
iv bb even, r{1,b}r\in\{1,b\} b+1b+1 0 [(01)k1]\left[(01)^{k}1\right]^{\infty}
v bb even, r>1r>1 odd b+cb+c 0 [((01)k1)q+11r1]\left[((01)^{k}1)^{q+1}1^{r-1}\right]^{\infty}
vi bb even, r=b2r=b-2 c+1c+1 0 [((01)k1)q(01)k11]\left[((01)^{k}1)^{q}(01)^{k-1}1\right]^{\infty}​​
vii bb even, c>b+1c>b+1, r<b2r<b-2 even, q>γq>\gamma c+1c+1 γ(b+c+2)b1\gamma(b+c+2)-b-1 Equation 17
viii bb even, c>b+1c>b+1, r<b2r<b-2 even, q<γq<\gamma b+cb+c q(b+c+2)b1q(b+c+2)-b-1 Equation 17
ix bb even, c>b+1c>b+1, r<b2r<b-2 even, q=γq=\gamma b1b-1 q(b+c+2)a1q(b+c+2)-a-1 Equation 17
Refer to caption
Figure 1: Theorem 4.1 proves that PrePer({1,b,c})0\operatorname{PrePer}(\{1,b,c\})\neq 0 exactly when bb is even, c>b+1c>b+1, and r<b2r<b-2 is even, with r:c(modb+1)r:\equiv c\pmod{b+1}.

The last three cases yield the most interesting results, providing an exact specification of the existence and structure of preperiods. These can be visualized in Figures 1 and 2.

Proof (i).

If bb and cc are odd, then they are both extensions of {1}\{1\} as in Example 2.11, so {wA}={w{1}}=(01)\{w^{A}\}=\{w^{\{1\}}\}=(01)^{\infty}. ∎

Proof (ii).

Suppose bb is odd and cc is even. For n<cn<c, w(nc)=1w(n-c)=1, so w(n)=1min{w(n1),w(nb),1}w(n)=1-\min\{w(n-1),w(n-b),1\}, and therefore wA(n)=w{1,b}(n)=w{1}(n)w^{A}(n)=w^{\{1,b\}}(n)=w^{\{1\}}(n), because bb is an extension of {1}\{1\}. Thus {wA}=(01)c/2𝑐\{w^{A}\}=(01)^{c/2}\underset{c}{\ldots} Now for all n[c,c+b)n\in[c,c+b), we find that nb<cn-b<c and nc<cn-c<c. Therefore if nn is odd, then nbn-b is even so w(nb)=0w(n-b)=0 and therefore w(n)=1w(n)=1. If nn is even then ncn-c is even so w(nc)=0w(n-c)=0 and therefore w(n)=1w(n)=1. Thus:

{wA}=(01)c/21bb+c\{w^{A}\}=(01)^{c/2}1^{b}\underset{b+c}{\ldots}

Because wA(b+c1)=1w^{A}(b+c-1)=1, Corollary 2.12.2 of the translating zeros lemma implies that this is the entire period with no preperiod.

Proof (iii).

Suppose b=2kb=2k and c=b+1c=b+1. For n<cn<c we have a single period of {1,b}\{1,b\}, specifically {wA}=(01)k1𝑐\{w^{A}\}=(01)^{k}1\underset{c}{\ldots} Next, for n[b+1,2b)n\in[b+1,2b), we find that nb<b+1n-b<b+1 and nc<bn-c<b. If nn is odd, then ncn-c is even so w(nc)=0w(n-c)=0 and thus w(n)=1w(n)=1. If nn is even, then nbn-b is even so w(nb)=0w(n-b)=0 and thus w(n)=1w(n)=1. This yields {wA}=(01)k1bb+c\{w^{A}\}=(01)^{k}1^{b}\underset{b+c}{\ldots}. Because v(b+c)=v(0)=1c\vec{v}(b+c)=\vec{v}(0)=1^{c}, this is the entire period with no preperiod, as implied by Lemma 2.13. ∎

Proof (iv).

Suppose b=2kb=2k and r{1,b}r\in\{1,b\}. Then cc is an extension of {1,b}\{1,b\} by Proposition 2.10, so {wA}={w{1,b}}=((01)k1)\{w^{A}\}=\{w^{\{1,b\}}\}=\big{(}(01)^{k}1\big{)}^{\infty}. ∎

Proof (v).

Suppose b=2kb=2k and r>1r>1 is odd. As above, for the first cc elements of the sequence, {wA}\{w^{A}\} is equal to {w{1,b}}\{w^{\{}1,b\}\}.

{w{1,2k}}=((01)k1)q(01)r-120𝑐\{w^{\{1,2k\}}\}=\big{(}(01)^{k}1\big{)}^{q}(01)^{\frac{r\text{-}1}{2}}0\underset{c}{\ldots}

Now let n=q(b+1)+mn=q(b+1)+m for m[r,b)m\in[r,b). This means that nb<q(b+1)n-b<q(b+1) and nc=mrn-c=m-r. If mm is odd, then nbn-b is odd so w(nb)=0w(n-b)=0, so w(n)=1w(n)=1. If mm is even, then w(n1)=1w(n-1)=1 and w(nb)=1w(n-b)=1 and w(nc)=w(mr)=1w(n-c)=w(m-r)=1, so w(n)=0w(n)=0. This extends the sequence to

{wA}=((01)k1)q(01)kq(b+1)+b\{w^{A}\}=\big{(}(01)^{k}1\big{)}^{q}(01)^{k}\underset{q(b+1)+b}{\ldots}

We just showed w(q(b+1))=0w(q(b+1))=0, so w(q(b+1)+b)=1w(q(b+1)+b)=1.

{wA}=((01)k1)q(01)k1(q+1)(b+1)\{w^{A}\}=\big{(}(01)^{k}1\big{)}^{q}(01)^{k}1\underset{(q+1)(b+1)}{\ldots}

Now let n=(q+1)(b+1)+mn=(q+1)(b+1)+m for m[0,r1)m\in[0,r-1). If mm is odd, then nb=q(b+1)+m+1n-b=q(b+1)+m+1, which has an even remainder less than bb, so w(nb)=0w(n-b)=0 and therefore w(n)=1w(n)=1. If mm is even, then nc=b+1(rm)n-c=b+1-(r-m), which is even and less than b+1b+1, so w(nc)=0w(n-c)=0 and therefore w(n)=1w(n)=1. We then extend the sequence.

{wA}=((01)k1)q(01)k1rb+c=((01)k1)q+11r1b+c\{w^{A}\}=\big{(}(01)^{k}1\big{)}^{q}(01)^{k}1^{r}\underset{b+c}{\ldots}=\big{(}(01)^{k}1\big{)}^{q+1}1^{r-1}\underset{b+c}{\ldots}

Because wA(b+c1)=1w^{A}(b+c-1)=1, we may again apply Corollary 2.12.2 to claim that this is the complete period with no preperiod.

Note that if r=1r=1, this solution still works and has sub-period b+1b+1, which agrees with (iv). ∎

Refer to caption
Figure 2: Theorem 4.1 proves that PrePer({1,b,c})=min(cb,ar22)(b+c+2)b1\operatorname{PrePer}(\{1,b,c\})=\min\left(\left\lfloor\frac{c}{b}\right\rfloor,\frac{a-r-2}{2}\right)(b+c+2)-b-1 whenever it is nonzero. This is approximately quadradic in cc when cc is close to bb, and transitions to linear when cbc\gg b.
Proof (vi, vii, viii, ix).

Assume b=2kb=2k, rr is even, and c>b+1c>b+1, and recall γ=br22\gamma=\frac{b-r-2}{2}. All four of the remaining cases are expressed in the following equation. Interestingly, the preperiod structure is the same for all cases.

{wA}=i=0min(q,γ)1(((01)k1)qi((01)k11)i(01)r/2+i12(γi)+1(01)k(γi)1)({((01)k1)qγ((01)k11)γ+1γq((01)k11)q(01)r/2+q12(γq)+1(01)r/2+q1γq)\{w^{A}\}\!=\sum_{i=0}^{\min(q,\gamma)-1}\Big{(}((01)^{k}1)^{q-i}((01)^{k-1}1)^{i}(01)^{r/2+i}1^{2(\gamma-i)+1}(01)^{k-(\gamma-i)}1\Big{)}\\ \left(\begin{cases}((01)^{k}1)^{q-\gamma}((01)^{k-1}1)^{\gamma+1}&\gamma\leq q\\ ((01)^{k-1}1)^{q}(01)^{r/2+q}1^{2(\gamma-q)+1}(01)^{r/2+q}1&\gamma\geq q\end{cases}\right)^{\infty} (17)

A proof of this Equation is given in Subsection 4.1. We simply check that the recurrence relation is satisfied.

In case (vi) where r=b2r=b-2, this means γ=0\gamma=0 so the summation is empty and there is no preperiod. Because we assume q1q\geq 1, this falls into the γq\gamma\leq q case of Equation 17, which has length q(b+1)+(b+1)2=c+1q(b+1)+(b+1)-2=c+1.

In the remaining cases both qq and γ\gamma are nonzero, and each term in the preperiod summation has length

(qi)(b+1)+i(b1)+(r+2i)+2(γi)+1+2(k(γi))+1=q(b+1)2i+r+2i+2k+2=c+b+2.(q-i)(b+1)+i(b-1)+(r+2i)+2(\gamma-i)+1+2(k-(\gamma-i))+1\\ =q(b+1)-2i+r+2i+2k+2=c+b+2.

Examine the last b+1b+1 values of the last term in the summation, 22(γmin(q,γ)+1)(01)k(γmin(q,γ)+1)12^{2(\gamma-\min(q,\gamma)+1)}(01)^{k-(\gamma-\min(q,\gamma)+1)}1. If γq\gamma\leq q, this is 12(01)k111^{2}(01)^{k-1}1, which is equal to the last b+1b+1 values of the period structure. If qγq\leq\gamma, this is equal to 22(γq+1)(01)kγ+q11=22(γq+1)(01)r/2+q2^{2(\gamma-q+1)}(01)^{k-\gamma+q-1}1=2^{2(\gamma-q+1)}(01)^{r/2+q}, which is also equal to the last b+1b+1 values of the period structure. This implies that the preperiod transitions into the period b+1b+1 steps earlier than depicted in Equation 17, and has length min(q,γ)(b+c+2)b1\min(q,\gamma)(b+c+2)-b-1.

In cases (vii) and (viii), Per(A)\operatorname{Per}(A) can be computed simply by counting the length of the strings in Equation 17. The period for γq\gamma\leq q has length

(b+1)(qγ)+(b+12)(γ+1)=(b+1)q2γ+b2+1=(b+1)q+r+1=c+1.(b+1)(q-\gamma)+(b+1-2)(\gamma+1)=(b+1)q-2\gamma+b-2+1=(b+1)q+r+1=c+1.

The period for qγq\leq\gamma has length

q(a+12)+(r+2q)+(2γ2q+1)+(r+2q)+1=q(a+1)+2r+2γ+2=b+a.q(a+1-2)+(r+2q)+(2\gamma-2q+1)+(r+2q)+1=q(a+1)+2r+2\gamma+2=b+a.

In case (ix), where γ=q\gamma=q, recall that r+2γ=2k2r+2\gamma=2k-2. This allows us to simplify r/2+q=r/2+γ=k1r/2+q=r/2+\gamma=k-1, so the two period structures are equivalent and can be expressed as ((01)k11)((01)^{k-1}1)^{\infty}, which has period b1b-1.

We might also notice that Equation 17 also holds if r=br=b (with no preperiod) and agrees with case (iv). In this case we would have γ=1\gamma=-1 so γq\gamma\leq q and {wA}=((01)k1)\{w^{A}\}=((01)^{k}1)^{\infty}. ∎

One result of this is that preperiod lengths can be arbitrarily longer than periods in the {1,b,c}\{1,b,c\} case. This can be seen in Figure 2, where the preperiod length appears quadratic in cc.

Example 4.2.

Let b=2kb=2k and c=k(b+1)c=k(b+1). Then A={1,2k,2k2+k}A=\{1,2k,2k^{2}+k\}. This means q=kq=k, r=0r=0, and γ=k1\gamma=k-1. Noting that γ<q\gamma<q, Equation 17 yields

{wA}=i=0k2(((01)k1)ki((01)k11)i(01)i12(ki)1(01)i+11)((01)k1((01)k11)k)\{w^{A}\}\!=\sum_{i=0}^{k-2}\Big{(}((01)^{k}1)^{k-i}((01)^{k-1}1)^{i}(01)^{i}1^{2(k-i)-1}(01)^{i+1}1\Big{)}\\ \left((01)^{k}1((01)^{k-1}1)^{k}\right)^{\infty} (18)

and Theorem 4.1 (case vii) gives Per(A)=2k2+k+1\operatorname{Per}(A)=2k^{2}+k+1, and PrePer(A)=(k1)(2k+2k2+k+2)2k1=2k3+k23k3\operatorname{PrePer}(A)=(k-1)(2k+2k^{2}+k+2)-2k-1=2k^{3}+k^{2}-3k-3.

If we instead choose b=2kb=2k and c=(k1)(b+1)c=(k-1)(b+1), we would have q=γq=\gamma (case ix) so Per(A)=2k1\operatorname{Per}(A)=2k-1 and PrePer(A)=2k33k2+2k4\operatorname{PrePer}(A)=2k^{3}-3k^{2}+2k-4.

For general 3-sets, Althöfer and Bülterman [1, problem (vi)] provided the example A={2s,4s+1,22s+2}A=\{2s,4s+1,22s+2\} with Per(A)=26s+3\operatorname{Per}(A)=26s+3, though they err in giving PrePer(A)=24s24s+1\operatorname{PrePer}(A)=24s^{2}-4s+1 for s[2,20]s\in[2,20] while actually PrePer(A)=24s24s1\operatorname{PrePer}(A)=24s^{2}-4s-1 for all s[2,200]s\in[2,200]. Another example follows from [6, thm 2]. If A={k,k+2,2k+3}A=\{k,k+2,2k+3\}, then PrePer(A)=12(3k25)\operatorname{PrePer}(A)=\frac{1}{2}(3k^{2}-5) and Per(A)=2\operatorname{Per}(A)=2. Thus for general 33-sets, PrePer(A)\operatorname{PrePer}(A) is not bounded by any function of Per(A)\operatorname{Per}(A), whereas for A={1,b,c}A=\{1,b,c\}, Theorem 4.1 shows that PrePer(A)=𝒪(Per(A)3)\operatorname{PrePer}(A)=\mathcal{O}(\operatorname{Per}(A)^{3}).

In Section 3, we used the A={1,b}A=\{1,b\} case to characterize all possible 22-sets using a permutation of wAw^{A}. A similar strategy may be possible if we could characterize all periodicities of {1,b,c}\{1,b,c\}, though this would be more complicated. In particular, note that the length of the periods are highly dependent on seeds, unlike the {a,b}\{a,b\} case. An example of this is proven in Section 6 and visualized in Figure 7.

Suppose A={a,b,c}A=\{a,b,c\} and we are given any string YY with |Y|=p|Y|=p. If gcd(a,p)=1\gcd(a,p)=1, then we let a-1a^{\text{-}1} be the multiplicative inverse of aa in p×\mathbb{Z}^{\times}_{p} and b:a-1b(modp)b^{\prime}:\equiv a^{\text{-}1}b\pmod{p} and c:a-1c(modp)c^{\prime}:\equiv a^{\text{-}1}c\pmod{p}. We see X=σa,p(Y)X=\sigma_{a,p}(Y) is a permutation of YY, so we could show in a manner similar to Theorem 3.9 that Y𝒲{a,b,c}Y^{\infty}\in\mathcal{W}^{\{a,b,c\}} if and only if X𝒲{1,b,c}X^{\infty}\in\mathcal{W}^{\{1,b^{\prime},c^{\prime}\}}. Thus as long as pp and aa are coprime, we have 𝒲a,b,c(p)=σa-1,p[𝒲1,b,c(p)]\mathcal{W}^{a,b,c}(p)=\sigma_{a^{\text{-}1},p}\left[\mathcal{W}^{1,b^{\prime},c^{\prime}}(p)\right]. This observation carries little information without further understanding of 𝒲1,b,c\mathcal{W}^{1,b,c}.

As an example we apply Lemma 6.1. Choose any nn\in\mathbb{N} and d1d\geq 1. Let b=4n+2d+1b=4n+2d+1 and let p=2(n+1)b+1p=2(n+1)b+1. Lemma 6.1 will imply that p𝒫{1,b,b+1}p\in\mathcal{P}^{\{1,b,b+1\}}. 2 is coprime to pp, so calculate that 2-1=(n+1)b+12^{\text{-}1}=(n+1)b+1 and 2-1b=(2n+d)+2-1=(n+1)b+2n+d+12^{\text{-}1}b=(2n+d)+2^{\text{-}1}=(n+1)b+2n+d+1, and finally 2-1(b+1)=2n+d+12^{\text{-}1}(b+1)=2n+d+1. Therefore there is some seed SS such that Per({2,2n+d+1,(n+1)b+2n+d+1},S)=2(n+1)b+1\operatorname{Per}(\{2,2n+d+1,(n+1)b+2n+d+1\},S)=2(n+1)b+1.

4.1 Building the preperiod sequence for {1,b,c}\{1,b,c\}

The statements in Theorems 4.1, 5.1, and Lemma 6.1 are somewhat tedious, so we provide three proofs of distinct flavors. In this section we provide a visual verification of Equation 17 to complete the proof of Theorem 4.1.

Proof.

We claim that if b=2kb=2k, q=c/(b+1)q=\left\lfloor c/(b+1)\right\rfloor, r=cqbr=c-qb is even c>b+1c>b+1, and γ=br22\gamma=\frac{b-r-2}{2}, then Equation 17 holds.

To verify the construction of the preperiod, we will confirm that for each term i{0,,min(q1,γ)}i\in\{0,\ldots,\min(q-1,\gamma)\}, the recurrence relation holds. If i=0i=0, note that the first cc entries proceed as w1,bw^{1,b}, so {wA}=((01)k1)q(01)r/2c\{w^{A}\}=\big{(}(01)^{k}1)^{q}(01)^{r/2}\underset{{}^{c}}{\ldots}, which agrees with the i=0i=0 term of Equation 17. Thus when considering prefixes we may assume i1i\geq 1. Suppose the ithi^{\text{th}} term starts at entry mm, and assume that the previous i1i-1 terms follow Equation 17.

The “alignment diagram” on the left hand side in Figure 3 re-writes the structure presented in Equation 17 on two lines such that wA(n)w^{A}(n) on the first line is horizontally justified with wA(nc)w^{A}(n-c) on the second line. To interpret this diagram, we simply confirm that for all nn, if wA(n)=0w^{A}(n)=0, then then look directly below to check that wA(nc)=1w^{A}(n-c)=1. Further, if wA(n)=1w^{A}(n)=1, then either wA(n1)=0w^{A}(n-1)=0 on the left, or wA(nc)=0w^{A}(n-c)=0 directly below (shown in bold), or neither is true and we must have wA(nb)=0w^{A}(n-b)=0 (underlined).

{wA(n)}=𝑚0(10)k111((01)k1011)qi1((01)k1)qi((01)k2011)i1(01)k11((01)k11))i(01)r/2+i101(11)γi1(01)r/2+i12(γi)+1(01)kγ+i1011(01)k(γi)1\{w^{A}(n)\}=\underset{m}{\ldots}\overbrace{0(10)^{k-1}1\textbf{1}\big{(}(01)^{k-1}01\textbf{1}\big{)}^{q-i-1}}^{\big{(}(01)^{k}1\big{)}^{q-i}}\overbrace{\!\big{(}(01)^{k-2}01\textbf{1}\big{)}^{i-1}(01)^{k-1}\hskip 58.0pt\textbf{1}}^{\big{(}(01)^{k-1}1)\big{)}^{i}}\overbrace{(01)^{r/2+i-1}01(\textbf{1}\textbf{\text@underline{1}})^{\gamma-i}\textbf{1}}^{\big{(}01\big{)}^{r/2+i}1^{{}^{2(\gamma-i)+1}}}\overbrace{(01)^{k-\gamma+i-1}01\textbf{1}}^{(01)^{k-(\gamma-i)}1}\ldots
{wA(nc)}=mc1(01)k110((10)k111((01)k1)qi10)qi1((10)k211((01)k11)i10)i1(10)r/2+i212(γi)+4(01)r/2+i112(γi+1)+10(10)r/2+i111(01)k(γi+1)1(01¯)γi0(10)kγ+i111(01)k10\{w^{A}(n-c)\}=\!\underset{m-c}{\ldots}\!1(01)^{k-1}1\underbrace{\!\textbf{0}\big{(}(10)^{k-1}11}_{\big{(}(01)^{k}1\big{)}^{q-i-1}}\underbrace{\!\textbf{0}\big{)}^{q-i-1}\!\big{(}(10)^{k-2}11}_{\big{(}(01)^{k-1}1\big{)}^{i-1}}\underbrace{\!\textbf{0}\big{)}^{i-1}(10)^{r/2+i-2}1^{2(\gamma-i)+4}}_{\big{(}01\big{)}^{r/2+i-1}1^{{}^{2(\gamma-i+1)+1}}}\underbrace{\textbf{0}\,(10)^{r/2+i-1}11}_{\big{(}01\big{)}^{k-(\gamma-i+1)}1}\underbrace{(\textbf{0}\underline{1})^{\gamma-i}\textbf{0}(10)^{k-\gamma+i-1}11}_{\big{(}01\big{)}^{k}1}\!\textbf{0}\ldots
{wA(n)}=𝑚(01)γi(01)k(γi)1011((01)k1011)qi1((01)k1)qi((01)k11)((01)k11)i1((01)k11))i(01)r/2+i(11)γi1(01)r/2+i12(γi)+1(01)k(γi)1011(01)k(γi)1\{w^{A}(n)\}=\underset{m}{\ldots}\overbrace{(01)^{\gamma-i}(01)^{k-(\gamma-i)-1}011\big{(}(01)^{k-1}011\big{)}^{q-i-1}}^{\big{(}(01)^{k}1\big{)}^{q-i}}\overbrace{\big{(}(01)^{k-1}1\big{)}\ \big{(}(01)^{k-1}1\big{)}^{i-1}}^{\big{(}(01)^{k-1}1)\big{)}^{i}}\,\overbrace{\,(01)^{r/2+i}(1\textbf{\text@underline{1}})^{\gamma-i}\hskip 29.0pt1}^{\big{(}01\big{)}^{r/2+i}1^{{}^{2(\gamma-i)+1}}}\,\overbrace{(01)^{k-(\gamma-i)-1}011}^{(01)^{k-(\gamma-i)}1}\ldots
{wA(nb)}=mb(11)γi(10)k(γi)111(01)k(γ(i1))10((10)k1110)qi1(10)k11((1((01)k1)qi 0)k11)i1((10)r/2+i(10)kr/21i1)(1((01)k11)i0)r/2+i1(01)r/2+i1\{w^{A}(n-b)\}=\!\underset{m-b}{\ldots}\!(11)^{\gamma-i}(1\underbrace{\!\!0)^{k-(\gamma-i)-1}11}_{(01)^{k-(\gamma-(i-1))}1}\!\underbrace{\!0\big{(}(10)^{k-1}110\big{)}^{q-i-1}\hskip 7.0pt(10)^{k-1}1\ \hskip 4.0pt\big{(}(1\!}_{\big{(}(01)^{k}1\big{)}^{q-i}}\underbrace{\!\,0)^{k-1}1\big{)}^{i-1}\big{(}(10)^{r/2+i}(1\textbf{0})^{k-r/2-1-i}1\big{)}(1}_{\big{(}(01)^{k-1}1\big{)}^{i}}\underbrace{\!0)^{r/2+i}\hskip 20.0pt1}_{\big{(}01\big{)}^{r/2+i}}\!1*\ldots
Figure 3: Two alignments diagrams re-writing the structure presented in Equation 17. See text for details.

Consider the additional case where qγq\leq\gamma and i=qi=q. The diagram nearly holds until the last b+1b+1 entries. In particular, we note that ((01)k1)qi=((01)^{k}1)^{q-i}=\emptyset, so the wA(nc)w^{A}(n-c) sequence should conclude with (01)k11(01)0(01)^{k-1}1(01)0 instead of (01)k10(01)^{k}10. Therefore the qthq^{\text{th}} term can be modified to
((01)k11)q(01)r/2+q12(γq)+1(01)k(γq)110101((01)^{k-1}1)^{q}(01)^{{r/2}+q}1^{2(\gamma-q)+1}(01)^{k-(\gamma-q)-1}10101.

The alignment diagram on the right hand side in Figure 3 similarly re-writes the structure such that wA(n)w^{A}(n) is horizontally justified with wA(nb)w^{A}(n-b). We must confirm that if wA(n)=0w^{A}(n)=0, then directly below, wA(nb)=1w^{A}(n-b)=1. We also confirm that the underlined entry has wA(nb)=0w^{A}(n-b)=0.

Therefore for all i[0,,min(q1,γ)]i\in[0,\ldots,\min(q-1,\gamma)], the ithi^{\text{th}} term follows the recurrence. Note that the * does not affect the recurrence, but represents that the value is unknown. This value is 11 if i<γi<\gamma but 0 if i=γi=\gamma. In either case, the recurrence holds. Now we consider the γq\gamma\leq q case. As justified above, after the γ1th\gamma-1^{\text{th}} term, the γth\gamma^{\text{th}} term begins at index m1m_{1} with

{wA}\displaystyle\{w^{A}\} =m1((01)k1)qγ((01)k11)γ(01)r/2+γ12(γγ)+1(01)k(γγ)1\displaystyle=\underset{m_{1}}{\ldots}\big{(}(01)^{k}1\big{)}^{q-\gamma}\big{(}(01)^{k-1}1)^{\gamma}(01)^{r/2+\gamma}1^{2(\gamma-\gamma)+1}(01)^{k-(\gamma-\gamma)}1\ldots
=m1((01)k1)qγ((01)k11)γ(01)k11(01)k1\displaystyle=\underset{m_{1}}{\ldots}\big{(}(01)^{k}1\big{)}^{q-\gamma}\big{(}(01)^{k-1}1)^{\gamma}(01)^{k-1}1(01)^{k}1\ldots
=m1((01)k1)qγ((01)k11)γ+1(01)k1\displaystyle=\underset{m_{1}}{\ldots}\big{(}(01)^{k}1\big{)}^{q-\gamma}\big{(}(01)^{k-1}1)^{\gamma+1}(01)^{k}1\ldots

We now observe that for Y=((01)k1)qγ((01)k11)γ+1Y=\big{(}(01)^{k}1\big{)}^{q-\gamma}\big{(}(01)^{k-1}1)^{\gamma+1}, the sequence YY^{\infty} satisfies the recurrence. Because YY has length c+1c+1, it suffices to check that Y(n)=1Y(n)=1 if and only if Y(n1)=0Y(n-1)=0 or Y(n+1)=0Y(n+1)=0 or Y(n2k)=0Y(n-2k)=0. YY satisfies this criterion by inspection.

Now consider the qγq\leq\gamma case. As justified above, after the q1thq-1^{\text{th}} term, the qthq^{\text{th}} term begins at index m1m_{1} with

{wA}\displaystyle\{w^{A}\} =m1((01)k1)qq((01)k11)q(01)r/2+q12(γq)+1(01)k(γq)110101\displaystyle=\underset{m_{1}}{\ldots}((01)^{k}1)^{q-q}((01)^{k-1}1)^{q}(01)^{r/2+q}1^{2(\gamma-q)+1}(01)^{k-(\gamma-q)-1}10101\ldots
=m1((01)k11)q(01)r/2+q12(γq)+1(01)r/2+q10101\displaystyle=\underset{m_{1}}{\ldots}((01)^{k-1}1)^{q}(01)^{r/2+q}1^{2(\gamma-q)+1}(01)^{r/2+q}1\hskip 7.0pt0101\ldots

Now, we show that for Y=((01)k11)q(01)r/2+q12(γq)+1(01)r/2+q1Y=((01)^{k-1}1)^{q}(01)^{r/2+q}1^{2(\gamma-q)+1}(01)^{r/2+q}1, the sequence YY^{\infty} satisfies the recurrence using alignment diagrams. Note that |Y|=b+c|Y|=b+c, and we start the diagram at Y(1)Y(-1) to simplify the diagram.

Y(n)\displaystyle Y^{\infty}(n) =11((01)k2011)q1(01)k11((01)k11))q(01)r/2+q101(11)γq1(01)r/2+q12(γ1)+1(01)r/2+q1011(01)r/2+q1\displaystyle=\underset{-1}{\ldots}\hskip 7.0pt1\overbrace{\!\big{(}(01)^{k-2}01\textbf{1}\big{)}^{q-1}(01)^{k-1}\hskip 59.0pt\textbf{1}}^{\big{(}(01)^{k-1}1)\big{)}^{q}}\overbrace{(01)^{r/2+q-1}01\hskip 1.0pt(\textbf{1}\textbf{\text@underline{1}})^{\gamma-q}\textbf{1}}^{\big{(}01\big{)}^{r/2+q}1^{{}^{2(\gamma-1)+1}}}\overbrace{\!(01)^{r/2+q-1}\hskip 4.0pt01\textbf{1}}^{(01)^{r/2+q}1}\ldots
Y(nc)\displaystyle Y^{\infty}(n-c) =1c0((10)k211((01)k21)q10)i1(10)r/2+q112(γq)+2(01)r/2+q12(γq)+10(10)r/2+q111(01)r/2+q1(01¯)γq0(10)kγ+q211(01)k110\displaystyle=\!\!\underset{-1-c}{\ldots}\underbrace{\textbf{0}\big{(}(10)^{k-2}11}_{\big{(}(01)^{k-2}1\big{)}^{q-1}}\underbrace{\!\textbf{0}\big{)}^{i-1}(10)^{r/2+q-1}1^{2(\gamma-q)+2}}_{\big{(}01\big{)}^{r/2+q}1^{{}^{2(\gamma-q)+1}}}\underbrace{\textbf{0}\,(10)^{r/2+q-1}11}_{\big{(}01\big{)}^{r/2+q}1}\underbrace{(\textbf{0}\underline{1})^{\gamma-q}\textbf{0}(10)^{k-\gamma+q-2}\hskip 1.0pt11}_{\big{(}01\big{)}^{k-1}1}\!\textbf{0}\ldots

Similarly checking the recurrence for bb:

Y(n)\displaystyle Y^{\infty}(n) =0((01)k11)((01)k11)q1((01)k11))q(01)r/2+q(11)γi1(01)r/2+i12(γi)+1(01)r/2+q1(01)r/2+q1\displaystyle=\underset{0}{\ldots}\overbrace{\big{(}(01)^{k-1}\hskip 53.0pt1\big{)}\big{(}(01)^{k-1}1\big{)}^{q-1}}^{\big{(}(01)^{k-1}1)\big{)}^{q}}\,\overbrace{\,(01)^{r/2+q}(1\textbf{\text@underline{1}})^{\gamma-i}\hskip 29.0pt1}^{\big{(}01\big{)}^{r/2+i}1^{{}^{2(\gamma-i)+1}}}\,\overbrace{(01)^{r/2+q}1}^{(01)^{r/2+q}1}\ldots
Y(nb)\displaystyle Y^{\infty}(n-b) =0b(11)γq(10)kγ+q11((1(01)r/2+q1 0)k11)q1((10)r/2+q(10)kr/21i1)(1((01)k11)q0)r/2+q1(01)r/2+q\displaystyle=\underset{0-b}{\ldots}\hskip 3.0pt(11)^{\gamma-q}(1\underbrace{\!0)^{k-\gamma+q-1}1\hskip 5.0pt\big{(}(1\!}_{(01)^{r/2+q}1}\underbrace{\!\,0)^{k-1}1\big{)}^{q-1}\big{(}(10)^{r/2+q}(1\textbf{0})^{k-r/2-1-i}1\big{)}(1}_{\big{(}(01)^{k-1}1\big{)}^{q}}\underbrace{\!\!0)^{r/2+q}1}_{\big{(}01\big{)}^{r/2+q}}\!\ldots

These diagrams verify that YY^{\infty} satisfies the recurrence, and this completes the proof that Equation 17 holds. ∎

5 The {a,b,a+b}\{a,b,a+b\} case

In [4, p. 531], Berlekamp et. al state without proof that the period lengths of the {a,b,a+b}\{a,b,a+b\} game are quadratic and give a formula for the period length of the Grundy sequence 𝒢(n)\mathcal{G}(n). In [1], Althöfer and Bülterman prove a particular example of this case (Example 5.2). In this section we provide a proof for the general {a,b,a+b}\{a,b,a+b\} game by finding {wA}\{w^{A}\} explicitly, which was presented as open by Ho in [9, table 4].

Theorem 5.1.

Suppose A={a,b,a+b}A=\{a,b,a+b\} with a<ba<b. Define k=b12ak=\left\lfloor\frac{b-1}{2a}\right\rfloor, σi:ib(moda)\sigma_{i}:\equiv ib\pmod{a}, and δi:=𝟏(σi>σi1)\delta_{i}:=\mathbf{1}(\sigma_{i}>\sigma_{i-1}), with the exception δ1=0\delta_{1}=0.444This means δi=1\delta_{i}=1 if σi>σi1\sigma_{i}>\sigma_{i-1} and δi=0\delta_{i}=0 if not. Let a~=a/gcd(a,b)\tilde{a}=a/\gcd(a,b). Then

{wA}={(i=1a~1((0a1a)kδi0σi1b0aσi1a)0a1a+b)1b<a(mod2a)((0a1a)k0a1a+b)Otherwise\{w^{A}\}=\begin{cases}\displaystyle\left(\sum_{i=1}^{\tilde{a}-1}\left((0^{a}1^{a})^{k-\delta_{i}}0^{\sigma_{i}}1^{b}0^{a-\sigma_{i}}1^{a}\right)0^{a}1^{a+b}\right)^{\infty}&1\leq b<a\pmod{2a}\\ \left((0^{a}1^{a})^{k}0^{a}1^{a+b}\right)^{\infty}&\text{Otherwise}\end{cases} (19)

It follows that

Per(A)={a~(2b2ka)1b<a(mod2a)b+2a(k+1)Otherwise\operatorname{Per}(A)=\begin{cases}\tilde{a}(2b-2ka)&1\leq b<a\pmod{2a}\\ b+2a\left(k+1\right)&\text{Otherwise}\end{cases} (20)
Refer to caption

​​​​​​​​​​​ ​​​​​ Refer to caption

Figure 4: Two plots of Per({a,b,a+b})\operatorname{Per}(\{a,b,a+b\}) with fixed aa. Note the phase transition from linear period lengths to quadratic, as well as the dips when gcd(a,b)1\gcd(a,b)\neq 1. See Figure 6 for a more extreme example.

Berlekamp et. al [4, p. 531] inspire an alternate formulation of Equation 20. If we let b=2ha+ρb=2ha+\rho for ρ(a,a]\rho\in(-a,a], then the following also holds:

Per(A)={a~(2b+ρ)1ρ<a  2b+ρρ0 or ρ=a\operatorname{Per}(A)=\begin{cases}\tilde{a}(2b+\rho)&1\leq\rho<a\\ \ \ \,2b+\rho&\rho\leq 0\text{ or }\rho=a\end{cases}
Proof.

We separate this proof into 22 cases, beginning with the simpler linear case.

Case 1: If ba(mod2a)b\geq a\pmod{2a} or b0(mod2a)b\equiv 0\pmod{2a}, we can let b=qa+rb=qa+r for odd q=2k+1q=2k+1 and r[0,a]r\in[0,a].

For n<bn<b we find wA(n)=w{a}(n)w^{A}(n)=w^{\{a\}}(n), and {w{a}}=(0a1a)\{w^{\{a\}}\}=(0^{a}1^{a})^{\infty}. Because qq is odd,

{wA}=\displaystyle\{w^{A}\}=\ (0a1a)k0a1r𝑏\displaystyle\ \left(0^{a}1^{a}\right)^{k}0^{a}1^{r}\ \underset{b}{\ldots}

Next, for all n[b,b+qa)n\in[b,b+qa), we see that if w(nb)=0w(n-b)=0 then both w(n)=1w(n)=1 and w(n+a)=1w(n+a)=1. This fills in the next portion of the sequence; we use underline and bold characters to highlight the structure of the recurrence.

{wA}=\displaystyle\{w^{A}\}=\ (0¯a1a)k0¯a1r(1¯a1a)k1¯a1a=(0a1a)k0a1a+bb+qa+a\displaystyle\ \left(\underline{0}^{a}1^{a}\right)^{k}\underline{0}^{a}1^{r}\left(\underline{1}^{a}\textbf{1}^{a}\right)^{k}\underline{1}^{a}\textbf{1}^{a}\ \ =\ \ \left(0^{a}1^{a}\right)^{k}0^{a}1^{a+b}\underset{b+qa+a}{\ldots}

We now observe that v(b+(q+1)a)=1a+b=v(0)\vec{v}\big{(}b+(q+1)a\big{)}=1^{a+b}=\vec{v}(0), which proves that Per(A)=b+2a(k+1)\operatorname{Per}(A)=b+2a(k+1) with no preperiod. We now move to the quadratic case.

Case 2: If 1b<a(mod2a)1\leq b<a\pmod{2a}, then we will have b=qa+rb=qa+r, for r[1,a)r\in[1,a) and q=2kq=2k. Again for n<bn<b, the sequence is identical to w{a}w^{\{a\}}.

{wA}=\displaystyle\{w^{A}\}=\ (0a1a)k0r𝑏\displaystyle\ \left(0^{a}1^{a}\right)^{k}0^{r}\underset{b}{\ldots}

Once again for n[b,2b)n\in[b,2b), we notice that if wA(nb)=0w^{A}(n-b)=0, then by the recurrence wA(n)=wA(n+a)=1w^{A}(n)=w^{A}(n+a)=1. This means that for all n[b,2b)[(2br)+a,2b+a)n\in[b,2b)\cup[(2b-r)+a,2b+a), we have w(n)=1w(n)=1, as illustrated in the equation below. This leaves a gap of length ara-r. In this gap n[2b,(2br)+a)n\in[2b,(2b-r)+a), we find w(na)=w(nb)=w(nab)=1w(n-a)=w(n-b)=w(n-a-b)=1, so indeed w(n)=0w(n)=0.

{wA}=\displaystyle\{w^{A}\}=\ (0¯a1a)k0¯rb(1¯a1a)k1¯rb0ar1r2b+a=(0a1a)k0r1b0ar 1r2b+a\displaystyle\ \underbrace{\left(\underline{0}^{a}1^{a}\right)^{k}\underline{0}^{r}}_{b}\underbrace{(\underline{1}^{a}\textbf{1}^{a})^{k}\underline{1}^{r}}_{b}0^{a-r}{\ }\textbf{1}^{r}\underset{2b+a}{\ldots}\ \ =\ \ \left(0^{a}1^{a}\right)^{k}0^{r}1^{b}0^{a-r}{\ }1^{r}\underset{2b+a}{\ldots}

Because we showed n[2b,2b+ar)n\in[2b,2b+a-r) has w(n)=0w(n)=0, this implies w(n+a)=1w(n+a)=1, so we may append (ar)(a-r) 11’s after 2b+a2b+a.

{wA}=\displaystyle\{w^{A}\}=\ (0a1a)k0r1b0ar 1a2b+2ar\displaystyle\ \left(0^{a}1^{a}\right)^{k}0^{r}1^{b}0^{a-r}{\ }1^{a}\underset{2b+2a-r}{\ldots}

This completes the first term in the summation, where σ1=r\sigma_{1}=r and δ1=0\delta_{1}=0. Using this as a base case for induction, we now show that the i+1thi+1^{\text{th}} term in the summation succeeds the ithi^{\text{th}} term. Suppose

{wA}=\displaystyle\{w^{A}\}=\ (0a1a)kδi0σi1b0aσi1a\displaystyle\ \ldots\left(0^{a}1^{a}\right)^{k-\delta_{i}}0^{\sigma_{i}}1^{b}0^{a-\sigma_{i}}1^{a}\ldots

We need only consider recent values of w(n)w(n) back to w(nab)w(n-a-b), so define the index mm such that
{wA}=𝑚1ba+σi0aσi 1a\{w^{A}\}=\underset{m}{\ldots}1^{b-a+\sigma_{i}}0^{a-\sigma_{i}}{\ }1^{a}\ldots Now let m1=m+(ba+σi)m_{1}=m+(b-a+\sigma_{i}) and notice that v(m1)\vec{v}(m_{1}) ends with a long string of ones. In particular we find that for all n[m+a+b,m1+b)n\in[m+a+b,m_{1}+b), we have wA(nab)=1w^{A}(n-a-b)=1 and wA(nb)=1w^{A}(n-b)=1, so wAw^{A} proceeds identically to w{a}w^{\{a\}} for a length of precisely b2a+σib-2a+\sigma_{i}. We must now consider sub-cases for parity, where σi+r<a\sigma_{i}+r<a or σi+ra\sigma_{i}+r\geq a. We show the two cases below

{wA}=\displaystyle\{w^{A}\}=\ (0a1a)kδi0σi1b0aσi1a 0a1a0a1abm1+b\displaystyle\ \ldots\left(0^{a}1^{a}\right)^{k-\delta_{i}}0^{\sigma_{i}}1^{b}\underbrace{0^{a-\sigma_{i}}1^{a}\ \ \ 0^{a}1^{a}0^{a}1^{a}\ldots}_{b}\underset{m_{1}+b}{\ldots}
=\displaystyle=\ {m1 0aσi1a(0a1a)k10σi+rm1+bσi+r<am1 0aσi1a(0a1a)k10a1σi+ram1+bσi+ra\displaystyle\ \begin{cases}\underset{m_{1}}{\ldots}\,{0^{a-\sigma_{i}}1^{a}\ \ \ (0^{a}1^{a})^{k-1}0^{\sigma_{i}+r}}\hskip 20.0pt\underset{m_{1}+b}{\ldots}&\sigma_{i}+r<a\\ \underset{m_{1}}{\ldots}\,{0^{a-\sigma_{i}}1^{a}\ \ \ (0^{a}1^{a})^{k-1}0^{a}1^{\sigma_{i}+r-a}}\underset{m_{1}+b}{\ldots}&\sigma_{i}+r\geq a\end{cases}

Note that in the two cases we can plug in σi+1=σi+r=\sigma_{i+1}=\sigma_{i}+r= and σi+1=σi+ra\sigma_{i+1}=\sigma_{i}+r-a respectively. In the second case, where σi+ra\sigma_{i}+r\geq a, then for n[(m1+b),(m1+b)+(aσi+1))n\in\big{[}(m_{1}+b),(m_{1}+b)+(a-\sigma_{i+1})\big{)}, we find wA(na)=0w^{A}(n-a)=0 so wA(na)=1w^{A}(n-a)=1. For n[(m1+b)+(aσi+1),(m1+b)+a)n\in\big{[}(m_{1}+b)+(a-\sigma_{i+1}),(m_{1}+b)+a\big{)}, we find wA(na)=wA(nb)=wA(nab)=1w^{A}(n-a)=w^{A}(n-b)=w^{A}(n-a-b)=1, so w(n)=0w(n)=0. Extend this second case below, defining m2m_{2} as the frontier of the sequence:

{wA}=\displaystyle\{w^{A}\}=\ {m1 0aσi1a(0a1a)k10σi+1m2σi+r<am1 0aσi1a(0a1a)k10a𝟏a0σi+1m2σi+ra\displaystyle\ \begin{cases}\underset{m_{1}}{\ldots}\,{0^{a-\sigma_{i}}1^{a}\ \ \ (0^{a}1^{a})^{k-1}0^{\sigma_{i+1}}}\hskip 20.0pt\underset{m_{2}}{\ldots}&\sigma_{i}+r<a\\ \underset{m_{1}}{\ldots}\,0^{a-\sigma_{i}}1^{a}\ \ \ (0^{a}1^{a})^{k-1}0^{a}\mathbf{1}^{a}0^{\sigma_{i+1}}\underset{m_{2}}{\ldots}&\sigma_{i}+r\geq a\end{cases}

This adds another copy of 0a1a0^{a}1^{a} to the sequence in the second case, and observe that δi+1=1\delta_{i+1}=1 in the first case and δi+1=0\delta_{i+1}=0 in the second. We can therefore combine cases. Additionally, we find that for n[m2,m2+b)n\in[m_{2},m_{2}+b), if w(nb)=0w(n-b)=0 then w(n)=w(n+a)=1w(n)=w(n+a)=1. This leads to another string of 1b1^{b} with a gap of length aσi+1a-\sigma_{i+1} which is filled with zeros. This is shown below, where m3=m2+b+am_{3}=m_{2}+b+a,

{wA}=(0¯a1a)kδi+10¯σi+1(1¯a1a)k1¯σi+1b0aσi+11σi+1am3\{w^{A}\}=\ldots\,(\underline{0}^{a}1^{a})^{k-\delta_{i+1}}\underline{0}^{\sigma_{i+1}}\underbrace{(\underline{1}^{a}\textbf{1}^{a})^{k}\underline{1}^{\sigma_{i+1}}}_{b}\underbrace{0^{a-\sigma_{i+1}}\textbf{1}^{\sigma_{i+1}}}_{a}\underset{m_{3}}{\ldots}

For n[m3,m3+(aσi+1))n\in\big{[}m_{3},m_{3}+(a-\sigma_{i+1})\big{)}, we see w(na)=0w(n-a)=0 so w(n)=1w(n)=1. This completes the inductive step as we show below:

{wA}=(0a1a)kδi0σi1b0aσi1a(0a1a)kδi+10σi+11b0aσi+11a\{w^{A}\}=\ldots\left(0^{a}1^{a}\right)^{k-\delta_{i}}0^{\sigma_{i}}1^{b}0^{a-\sigma_{i}}1^{a}\ \ \ \left(0^{a}1^{a}\right)^{k-\delta_{i+1}}0^{\sigma_{i+1}}1^{b}0^{a-\sigma_{i+1}}1^{a}\ldots

By induction this pattern will repeat. Let a~=agcd(a,b)\tilde{a}=\frac{a}{\gcd(a,b)}, which is the order of bb in a+\mathbb{Z}_{a}^{+}. Thus the a~th\tilde{a}^{\text{th}} iteration is the first such that σa~=0\sigma_{\tilde{a}}=0 and δa~=0\delta_{\tilde{a}}=0 so the sequence is

{wA}=i=1a~1((0a1a)kδi0σi1b0aσi1a)(0a1a)k1bm4\{w^{A}\}\ \ =\ \ \sum_{i=1}^{\tilde{a}-1}\Big{(}(0^{a}1^{a})^{k-\delta_{i}}0^{\sigma_{i}}1^{b}0^{a-\sigma_{i}}1^{a}\Big{)}\ (0^{a}1^{a})^{k}1^{b}\underset{m_{4}}{\ldots} (21)

We see that v(m4)=1a+b=v(0)\vec{v}(m_{4})=1^{a+b}=\vec{v}(0), so this is the entire period. We see that the ithi^{\text{th}} term of the summation has length 2ka2aδi+b+2a2ka-2a\delta_{i}+b+2a, and there are a~\tilde{a} total terms. We also compute that ra~a\frac{r\cdot\tilde{a}}{a} is the number of terms jj for which σj<σj1\sigma_{j}<\sigma_{j-1}, so if we include the first term δ1=0\delta_{1}=0 and exclude the last term δa~=0\delta_{\tilde{a}}=0, there are precisely r/gcd(a,b)r/\gcd(a,b) terms in the summation where δj=0\delta_{j}=0, and the rest have δi=1\delta_{i}=1. Therefore i=1a~1δi=(a~1)r/gcd(a,b)\sum_{i=1}^{\tilde{a}-1}\delta_{i}=(\tilde{a}-1)-r/\gcd(a,b). We conclude that the total period length is

Per(A)\displaystyle\operatorname{Per}(A) =i=1a~1(2ka2aδi+b+2a)+2ka+b\displaystyle=\sum_{i=1}^{\tilde{a}-1}(2ka-2a\delta_{i}+b+2a)+2ka+b
=(2ka(a~1)2a((a~1)r/gcd(a,b))+b(a~1)+2a(a~1))+2ka+b\displaystyle=(2ka(\tilde{a}-1)-2a((\tilde{a}-1)-r/\gcd(a,b))+b(\tilde{a}-1)+2a(\tilde{a}-1))+2ka+b
=2kaa~+2ar/gcd(a,b)+ba~\displaystyle=2ka\tilde{a}+2ar/\gcd(a,b)+b\tilde{a}
=3a~b2kaa~\displaystyle=3\tilde{a}b-2ka\tilde{a}\qed

The following example is given as a Theorem in [1].

-------------1111111111111---11111111111111111111111111111----------1111111111111
                          ------11111111111111111111111111111-------1111111111111
                          ---------11111111111111111111111111111----1111111111111
                          ------------11111111111111111111111111111-1111111111111
-------------1111111111111--11111111111111111111111111111-----------1111111111111
                          -----11111111111111111111111111111--------1111111111111
                          --------11111111111111111111111111111-----1111111111111
                          -----------11111111111111111111111111111--1111111111111
-------------1111111111111-11111111111111111111111111111------------1111111111111
                          ----11111111111111111111111111111---------1111111111111
                          -------11111111111111111111111111111------1111111111111
                          ----------11111111111111111111111111111---1111111111111
                          -------------111111111111111111111111111111111111111111
Figure 5: Let a=13a=13, b=2a+3b=2a+3, and A={13,29,42}A=\{13,29,42\}. We compute Per(A)=793\operatorname{Per}(A)=793, and the period structure is shown above, with - used for 0.
Example 5.2.

[1, Thm 3.1] Let A={a,2a+1,3a+1}A=\{a,2a+1,3a+1\}. Then Equation (19) gives the following sequence, where b=2a+1b=2a+1, k=1k=1, and σi=i\sigma_{i}=i so δi=1\delta_{i}=1 for all i[1,a1)i\in[1,a-1).

{wA}\displaystyle\{w^{A}\}\ \ =(0a1ai=1a1(0i1b0ai1a) 0a1a+b)\displaystyle=\ \ \Bigg{(}0^{a}1^{a}\sum_{i=1}^{a-1}\Big{(}0^{i}1^{b}0^{a-i}1^{a}\Big{)}\ 0^{a}1^{a+b}\Bigg{)}^{\infty}
=(0a1a 011b0a11a 021b0a21a 031b0a31a 0a1a+b)\displaystyle=\ \ \Bigg{(}0^{a}1^{a}\ \ 0^{1}1^{b}0^{a-1}1^{a}\ \ \ 0^{2}1^{b}0^{a-2}1^{a}\ \ \ 0^{3}1^{b}0^{a-3}1^{a}\ \ \ \ldots\ \ \ 0^{a}1^{a+b}\Bigg{)}^{\infty}

Additionally Per(A)=(6a2+3a)2a2=4a2+3a29max(A)2\operatorname{Per}(A)=(6a^{2}+3a)-2a^{2}=4a^{2}+3a\sim\frac{2}{9}\max(A)^{2}.

This class of sets appears to be the only case for |A|=3|A|=3 which can have superlinear period lengths with no seed. Further generalizations using this result and Theorem 4.1 might bring the following conjecture within reach.

Conjecture 1.

For all a<b<ca<b<c such that a+bca+b\neq c,

Per({a,b,c})<2c\operatorname{Per}(\{a,b,c\})<2c (22)

We have verified Conjecture 1 computationally for all {a,b,c}([200]3)\{a,b,c\}\in{[200]\choose 3}. If this conjecture is true, it must relate in part to some invariant of the structure caused by the initial seed of 1α1^{\alpha}, because it fails entirely for different seeds, even if a,b,a,b, and cc are coprime. This invariant would therefore be carried through the quadratic length preperiods seen in Section 4.

Refer to caption
Figure 6: The period lengths for {a,b,a+b}\{a,b,a+b\} where a=360a=360, a superior highly composite number.

6 Super-polynomial Period lengths with initial Seeds.

In this section we consider a particular family of sets which demonstrate that super-polynomial period lengths exist for 3-sets, given properly chosen initial seeds. This family will relate to an intersection of the cases of Sections 4 and 5.

Lemma 6.1.

For any nn\in\mathbb{N}, choose some odd b>4n+1b>4n+1 and let A={1,b,b+1}A=\{1,b,b+1\} and S=(013)nS=(01^{3})^{n}. Then Per(A,S)=2(n+1)b+1\operatorname{Per}(A,S)=2(n+1)b+1 and PrePer(A,S)=0\operatorname{PrePer}(A,S)=0.

A proof of this Lemma is found in Section 6.1. If we denote b=4n+1+2db=4n+1+2d, where d1d\geq 1, then the structure of the periodicity is exactly

{wA,S}=(i=0n1((11)d(130)i11(013)ni(01)d0(130)i11(013)ni10)(11)d(130)n12(01)d0(130)n),\{w^{A,S}\}=\ldots\left(\sum_{i=0}^{n-1}\Big{(}(11)^{d}(1^{3}0)^{i}11(01^{3})^{n-i}\ (01)^{d}0(1^{3}0)^{i}11(01^{3})^{n-i-1}0\Big{)}\ (11)^{d}(1^{3}0)^{n}1^{2}\ (01)^{d}0(1^{3}0)^{n}\right)^{\infty},

To choose a seed generating this structure it suffices to choose any sub-string of length a+1a+1, so we choose the first a+1a+1 entries, namely (11)d11(013)n(013)n(11)^{d}11(01^{3})^{n}\approx(01^{3})^{n}. Lemma 6.1 contradicts the generalization of Conjecture 1 over all seeds, since it implies quadratic period lengths. Figure 7 plots all period lengths for {1,b,b+1}\{1,b,b+1\}, which shows that this Lemma only scratches the surface of the periodicities of 33-sets.

Refer to caption
Figure 7: This figure shows all periods of {1,b,b+1}\{1,b,b+1\} for b+135b+1\leq 35. The points highlighted in blue are given by Lemma 6.1 and the points in red are the default periods. Note that some points close together are overlapping. For example, 𝒫{1,31,32}={3,7,11,21,33,63,125,167,187,249,251,311,313,\mathcal{P}^{\{1,31,32\}}=\{3,7,11,21,33,63,125,167,187,249,251,311,313,
373,375,377,435,437,439,497,499,501,503,563,565,629}373,375,377,435,437,439,497,499,501,503,563,565,629\}, while Lemma 6.1 gives only {63,125,187,\{63,125,187,
249,311,373,435,497}249,311,373,435,497\}.
Theorem 6.2 (Superpolynomial Period Lengths).

For n1n\geq 1, define bn=4n1b_{n}=4n-1, An={n,nbn,nbn+n}A_{n}=\{n,nb_{n},nb_{n}+n\}, and S(n)=j=1n10j1bnjS_{(n)}=\sum_{j=1}^{n-1}0^{j}1^{b_{n}-j}. For the family of pairs {An,S(n)}n=1\{A_{n},S_{(n)}\}_{n=1}^{\infty}, where αn=max(An)\alpha_{n}=\max(A_{n}), it holds that

Per(An,S(n))=eΩ(αn).\operatorname{Per}(A_{n},S_{(n)})=e^{\Omega(\sqrt{\alpha_{n}})}.
Proof.

Fix nn, so we have b=4n1b=4n-1 and A={n,bn,bn+n}A=\{n,bn,bn+n\}. We now construct the seed SS dependent on nn. Because AA has greatest common divisor nn, let B={1,b,b+1}B=\{1,b,b+1\} and apply Multiplicative Linearity Proposition 2.7 to see that the parallel sequences satisfy (wA,S)i(m)=wA,S(mn+i)=wB,Si(m)(w^{A,S})_{i}(m)=w^{A,S}(mn+i)=w^{B,S_{i}}(m) where Si{0,1}b+1S_{i}\in\{0,1\}^{b+1} for i{0,,n1}i\in\{0,\ldots,n-1\}. We now apply Lemma 6.1 by letting Si=(013)i14(ni)(013)iS_{i}=(01^{3})^{i}\approx 1^{4(n-i)}(01^{3})^{i}, so we have Per(B,Si)=2(i+1)b+1\operatorname{Per}(B,S_{i})=2(i+1)b+1. By combining all SiS_{i} in parallel, this construction yields S=i=0n11ni0i13n=j=1n0i1biS=\sum_{i=0}^{n-1}1^{n-i}0^{i}1^{3n}=\sum_{j=1}^{n}0^{i}1^{b-i}. Now, suppose {wA,S}\{w^{A,S}\} is periodic over some pp\in\mathbb{N}. This implies that for all mm\in\mathbb{N} and i{0,,n1}i\in\{0,\ldots,n-1\}, we have

wB,Si(m)=wA,S(mn+i)=wA,S(mn+i+np)=wB,Si(m+p),w^{B,S_{i}}(m)=w^{A,S}(mn+i)=w^{A,S}(mn+i+np)=w^{B,S_{i}}(m+p),

so {wB,Si}\{w^{B,S_{i}}\} must also be periodic over pp, i.e. Per(B,Si)p\operatorname{Per}(B,S_{i})\mid p. Because this is true for all ii, we conclude that lcm{2(i+1)b+10i<n}Per(An,S)\operatorname{lcm}\{2(i+1)b+1\mid 0\leq i<n\}\leq\operatorname{Per}(A_{n},S). A result from [2, Problem 10797] regarding the lcm of arithmetic progressions implies a somewhat loose bound of lcm(2b+1,4b+1,6b+1,,2na+1)eno(n)\operatorname{lcm}(2b+1,4b+1,6b+1,\ldots,2na+1)\geq e^{n-o(n)}.555In particular it says that limnlog(lcm())n=1φ(k)2bm\lim_{n\to\infty}\frac{\log(\operatorname{lcm}(\ldots))}{n}=\frac{1}{\varphi(k)}\sum\frac{2b}{m} with the summation taken over units of 2b×\mathbb{Z}_{2b}^{\times}. This is an average of numbers greater than 11. Therefore for all nn, we note that αn4n2\alpha_{n}\sim 4n^{2}, and conclude Per(An,Sn)=eΩ(n)=eΩ(αn)\operatorname{Per}(A_{n},S_{n})=e^{\Omega(n)}=e^{\Omega(\sqrt{\alpha_{n}})}. ∎

Table 2 demonstrates the construction for n=2n=2. This family proceeds as follows

  • n=1n=1, b=3b=3, A1={1,3,4}A_{1}=\{1,3,4\}, S1=S_{1}=\emptyset, and Per(A1,S1)=lcm{7}=7\operatorname{Per}(A_{1},S_{1})=\operatorname{lcm}\{7\}=7

  • n=2n=2, b=7b=7, A2={2,14,16}A_{2}=\{2,14,16\}, S2=016S_{2}=01^{6}, Per(A2,S2)=2lcm{15,29}=870\operatorname{Per}(A_{2},S_{2})=2\cdot\operatorname{lcm}\{15,29\}=870

  • n=3n=3, b=11b=11, A3={3,33,36}A_{3}=\{3,33,36\}, S3=01100219S_{3}=01^{10}0^{2}1^{9}, Per(A3,S3)=3lcm{23,45,67}=208 035\operatorname{Per}(A_{3},S_{3})=3\cdot\operatorname{lcm}\{23,45,67\}=208\,035

  • n=4n=4, b=15b=15, A4={4,60,64}A_{4}=\{4,60,64\}, S4=01140211303112S_{4}=01^{14}0^{2}1^{13}0^{3}1^{12}, Per(A4,S4)=4lcm{31,61,91,121}=83 287 204\operatorname{Per}(A_{4},S_{4})=4\cdot\operatorname{lcm}\{31,61,91,121\}=83\,287\,204

  • n=5n=5, b=19b=19, A5={5,95,100}A_{5}=\{5,95,100\}, S5=0118021170311604115S_{5}=01^{18}0^{2}1^{17}0^{3}1^{16}0^{4}1^{15}, and 3 364 005 645Per(A5,S5)3\,364\,005\,645\mid\operatorname{Per}(A_{5},S_{5}); we have not computed the exact period.

It is natural to predict that we have a multiple of nn in the period length, but we have not proven this to be the case. To prove Theorem 6.2 we used a rough bound on lcm{2b+1,,2nb+1}\operatorname{lcm}\{2b+1,\ldots,2nb+1\} and the few periodicities from Lemma 6.1, as shown in Figure 7. It is unclear if more periodicities and a stronger bound on their lcm\operatorname{lcm}, would yield an asymptotically better result, but this does not appear to be the case. Figure 8 shows that eΩ(αn)e^{\Omega(\sqrt{\alpha_{n}})} appears to be best possible.

Refer to caption
Figure 8: Using the periods from Figure 7, we can construct sets AbA_{b} with many parallel {1,b,b+1}\{1,b,b+1\} periods, specifically we get Ab=|𝒫{1,b,b+1}|{1,b,b+1}A_{b}=|\mathcal{P}^{\{1,b,b+1\}}|\cdot\{1,b,b+1\} and some seed SS comprised of S0,,S|𝒫{1,b,b+1}|S_{0},\ldots,S_{|\mathcal{P}^{\{1,b,b+1\}}|} such that Per(Ab,S)lcm(𝒫{1,b,b+1})\operatorname{Per}(A_{b},S)\geq\operatorname{lcm}(\mathcal{P}^{\{1,b,b+1\}}). This gives a heuristic for the longest period possible, which appears to approximate e𝒪(max(Ab))e^{\mathcal{O}(\sqrt{\max(A_{b})})}.
1 1 1 1 0 1 0 1 0 1 0 1
0 1 1 1 0 1 0 1 1 0 1 1
Table 2: In the construction for Theorem 6.2, we have A2={2,14,16}A_{2}=\{2,14,16\}. The sequences (wA,S)i(m)(w^{A,S})_{i}(m) for i{0,1}i\in\{0,1\} are independent, and these have periods of lengths 27+1=152\cdot 7+1=15 and 47+1=294\cdot 7+1=29. We find that Per(A2,016))=2lcm(15,29)=870\operatorname{Per}(A_{2},01^{6}))=2\cdot\operatorname{lcm}(15,29)=870.

6.1 Proof of Lemma 6.1.

The final proof uses different approach to the previous ones. Rather than constructing the sequence from scratch, we will exploit a structural pattern to extend a simple period. This was the method used to discover Lemma 6.1, and might be a productive strategy moving forward.

Proof.

First, we note that if n=0n=0, then Theorems 4.1 and 5.1 coincide to give that Per(A)=2b+1\operatorname{Per}(A)=2b+1 with no seed, so we are done. Next, fix n1n\geq 1.

Observe that if β=4n+1\beta=4n+1 and B={1,β,β+1}B=\{1,\beta,\beta+1\} then the string X=110(130)nX=110(1^{3}0)^{n} is a valid period structure of BB with period length β+2\beta+2. This follows from the fact that X(n)=1X^{\infty}(n)=1 if and only if X(n1)=0X^{\infty}(n-1)=0, X(n+1)=0X^{\infty}(n+1)=0, or X(n+2)=0X^{\infty}(n+2)=0, meaning each zero is separated by 22 or 33 ones. We use this fact to explicitly build period structures for odd b>βb>\beta.

Write 2n+12n+1 copies of XX in a (2n+2)×(β+1)(2n+2)\times(\beta+1) grid so that the rows 0,,2n+10,\ldots,2n+1 are the following: The kthk^{\text{th}} even row indexed from zero reads (130)k11(013)nk(1^{3}0)^{k}11(01^{3})^{n-k} and the kthk^{\text{th}} odd row reads 0(130)k11(013)nk100(1^{3}0)^{k}11(01^{3})^{n-k-1}0, except for the last row, (the nthn^{\text{th}} odd row), and this reads 0(130)n0(1^{3}0)^{n}. Table 3 gives two examples of such a filling. Notice that this filling has the following three properties.

  • Reading across all of the rows yields X2n+1X^{2n+1} in order.

  • Even rows are fully filled. These begin and end with strings 131^{3} or 1111. Their length is β+1=|X|1\beta+1=|X|-1 so they contain all of XX except for a 0.

  • Odd rows have β1\beta-1 entries, except for row nn which has β\beta entries. These begin and end with 0, and contain all of XX except either 131^{3} or 1111.

1 1 0 1 1 1
0 1 1 0
1 1 1 0 1 1
0 1 1 1 0
1 1 0 1 1 1 0 1 1 1
0 1 1 0 1 1 1 0
1 1 1 0 1 1 0 1 1 1
0 1 1 1 0 1 1 0
1 1 1 0 1 1 1 0 1 1
0 1 1 1 0 1 1 1 0
Table 3: Left. Setting n=1n=1, we get B={1,5,6}B=\{1,5,6\}. We place 2n+1=32n+1=3 copies of X=110130X=1101^{3}0 into a grid, so odd rows start and end with 0. Right. Setting n=2n=2, we get B={1,9,10}B=\{1,9,10\}. We place 55 copies of X=110130130X=1101^{3}01^{3}0 into a grid. Alternating copies of XX are bolded to illustrate the pattern.

Denote x(i,j)x(i,j) as the element in row ii and column jj, both indexed from 0. We can now re-interpret the recurrence relation on wB(n)w^{B}(n) in terms of xx. The following identities must hold for all i,ji,j.

x(i,j)={1min{x(i,j1),x(i1,j),x(i1,j+1)}i is odd and j>01min{x(i,j1),x(i1,j2),x(i1,j1)}i>0 is even,β>j>11min{x(i1,β),x(i1,0),x(i1,1)}i is odd and j=01min{x(0,j1),x(2n+1,j),x(2n+1,j1)}i=0,β>j>01min{x(2n+1,β1),x(2n+1,0),x(2n,β)}i=0,j=01min{x(0,β1),x(0,0),x(2n+1,β1)}i=0,j=β1min{x(i,β1),x(i,0),x(i1,β2)}i>0 is even,j=β1min{x(i,0),x(i1,0),x(i2,β)}i>0 is even,j=11min{x(i1,β2),x(i2,β),x(i2,β1)}i>0 is even,j=0x(i,j)=\begin{cases}1-\min\{x(i,j-1),x(i-1,j),x(i-1,j+1)\}&i\text{ is odd and }j>0\\ 1-\min\{x(i,j-1),x(i-1,j-2),x(i-1,j-1)\}&i>0\text{ is even},\beta>j>1\\ \\ 1-\min\{x(i-1,\beta),x(i-1,0),x(i-1,1)\}&i\text{ is odd and }j=0\\ 1-\min\{x(0,j-1),x(2n+1,j),x(2n+1,j-1)\}&i=0,\beta>j>0\\ 1-\min\{x(2n+1,\beta-1),x(2n+1,0),x(2n,\beta)\}&i=0,j=0\\ 1-\min\{x(0,\beta-1),x(0,0),x(2n+1,\beta-1)\}&i=0,j=\beta\\ 1-\min\{x(i,\beta-1),x(i,0),x(i-1,\beta-2)\}&i>0\text{ is even},j=\beta\\ 1-\min\{x(i,0),x(i-1,0),x(i-2,\beta)\}&i>0\text{ is even},j=1\\ 1-\min\{x(i-1,\beta-2),x(i-2,\beta),x(i-2,\beta-1)\}&i>0\text{ is even},j=0\end{cases} (23)

We focus on the first two cases which are the most general. It might also help to recall that for odd ii, x(i,0)=0x(i,0)=0 and for even ii, x(i,0)=x(i,1)=x(i,β1)=x(i,β)=1x(i,0)=x(i,1)=x(i,\beta-1)=x(i,\beta)=1. These follow from the specifications of the grid filling.

Next, we will choose any odd b=β+2db=\beta+2d for d>0d>0, and let A={1,b,b+1}A=\{1,b,b+1\}. We will extend the grid to create a period structure for AA with length 2(n+1)b+12(n+1)b+1. We add dd copies of the first two columns on the left side, as shown below.

1 1 1 1 1 1 1 1 0 1 1 1
0 1 0 1 0 1 0 1 1 0
1 1 1 1 1 1 1 1 1 0 1 1
0 1 0 1 0 1 0 1 1 1 0

(11)d+1 0 1 1 1 (01)d+1 1 0 (11)d+1 1 0 1 1 (01)d+1 1 1 0

Table 4: Example of extending the grid for b=β+2db=\beta+2d with n=1n=1 and d=3d=3.

We call the elements of this modified grid y(i,j)y(i,j), with ii indexed from 0 and jj indexed from 2d-2d. Thus for j0j\geq 0 we have y(i,j)=x(i,j)y(i,j)=x(i,j). If j<0j<0 is even we have y(i,j)=x(i,0)y(i,j)=x(i,0) and if j<0j<0 is odd we have y(i,j)=x(i,1)y(i,j)=x(i,1). Because of the specifications for filling xx, we note that this entails prepending (11)d(11)^{d} to even rows and (01)d(01)^{d} to odd rows.

Claim. Reading across the rows of this table yields YY, a valid period structure for AA with length 2(n+1)b+1{2(n+1)b+1}. First we have added (2n+2)2d(2n+2)2d entries to the table, and we started with X2n+1X^{2n+1}, so the total length is

(2n+2)2d+(2n+1)(β+2)=(2n+2)2d+(2n+2)β+1=2b(n+1)+1(2n+2)2d+(2n+1)(\beta+2)=(2n+2)2d+(2n+2)\beta+1=2b(n+1)+1

Next we show that the recurrence relation is satisfied. To do this, write the recurrence relation wA(n)=1min{wA(n1),wA(nβ2d),wA(nβ12d)w^{A}(n)=1-\min\{w^{A}(n-1),w^{A}(n-\beta-2d),w^{A}(n-\beta-1-2d) in terms of y(i,j)y(i,j). The rows are extended by the same length as the recurrence, so the following rules very are similar to Equation 23.

y(i,j)={1min{y(i,j1),y(i1,j),y(i1,j+1)}i is odd and j>2d1min{y(i,j1),y(i1,j2),y(i1,j1)}i>0 is even,β>j>12d1min{y(i1,β),y(i1,0),y(i1,1)}i is odd and j=01min{y(0,j1),y(2n+1,j),y(2n+1,j1)}i=0,β>j>2d1min{y(2n+1,β1),y(2n+1,β),y(2n+1,2d)}i=0,j=2d1min{y(0,β1),y(0,2d),y(2n+1,β1)}i=0,j=β1min{y(i,β1),y(i,2d),y(i1,β2)}i>0 is even,j=β1min{y(i,2d),y(i1,2d),y(i2,β)}i>0 is even,j=2d+11min{y(i1,β2),y(i2,β),y(i2,β1)}i>0 is even,j=2dy(i,j)=\begin{cases}1-\min\{y(i,j-1),y(i-1,j),y(i-1,j+1)\}&i\text{ is odd and }j>-2d\\ 1-\min\{y(i,j-1),y(i-1,j-2),y(i-1,j-1)\}&i>0\text{ is even},\beta>j>1-2d\\ \\ 1-\min\{y(i-1,\beta),y(i-1,0),y(i-1,1)\}&i\text{ is odd and }j=0\\ 1-\min\{y(0,j-1),y(2n+1,j),y(2n+1,j-1)\}&i=0,\ \beta>j>-2d\\ 1-\min\{y(2n+1,\beta-1),y(2n+1,\beta),y(2n+1,-2d)\}&i=0,j=-2d\\ 1-\min\{y(0,\beta-1),y(0,-2d),y(2n+1,\beta-1)\}&i=0,j=\beta\\ 1-\min\{y(i,\beta-1),y(i,-2d),y(i-1,\beta-2)\}&i>0\text{ is even},j=\beta\\ 1-\min\{y(i,-2d),y(i-1,-2d),y(i-2,\beta)\}&i>0\text{ is even},j=-2d+1\\ 1-\min\{y(i-1,\beta-2),y(i-2,\beta),y(i-2,\beta-1)\}&i>0\text{ is even},j=-2d\end{cases} (24)

From here it is possible to check that the nine cases in Equation 24 hold for all j0j\geq 0 and j<0j<0 using Equation 23, the definition of y(i,j)y(i,j) and the three properties of the filling. We will show only the two main cases; the rest follow suit.

If ii is odd and 0<j<β0<j<\beta, then we confirm

y(i,j)=x(i,j)=1min{x(i,j1),x(i1,j),x(i1,j+1)}=1min{y(i,j1),y(i1,j),y(i1,j+1)}.y(i,j)=x(i,j)=1-\min\{x(i,j-1),x(i-1,j),x(i-1,j+1)\}\\ =1-\min\{y(i,j-1),y(i-1,j),y(i-1,j+1)\}.

If ii is odd and 2d<j0-2d<j\leq 0 is even, then we know y(i,j)=x(i,0)=0y(i,j)=x(i,0)=0, so we confirm

y(i,j)=1min{y(i,j1),y(i1,j),y(i1,j+1)}=1min{1,1,1}=0.y(i,j)=1-\min\{y(i,j-1),y(i-1,j),y(i-1,j+1)\}=1-\min\{1,1,1\}=0.

If ii is odd and 2d<j<0-2d<j<0 is odd, then we know y(i,j)=x(i,1)=1y(i,j)=x(i,1)=1, so we confirm

y(i,j)=1min{y(i,j1),y(i1,j),y(i1,j+1)}=1min{0,1,0}=1.y(i,j)=1-\min\{y(i,j-1),y(i-1,j),y(i-1,j+1)\}=1-\min\{0,1,0\}=1.

If i>0i>0 is even and 1<j<β1<j<\beta, then

y(i,j)=x(i,j)=1min{x(i,j1),x(i1,j1),x(i1,j2)}=1min{y(i,j1),y(i1,j1),y(i1,j2)}.y(i,j)=x(i,j)=1-\min\{x(i,j-1),x(i-1,j-1),x(i-1,j-2)\}\\ =1-\min\{y(i,j-1),y(i-1,j-1),y(i-1,j-2)\}.

If i>0i>0 is even and 2d+1<j1-2d+1<j\leq 1 is odd, then we know y(i,j)=x(i,1)=1y(i,j)=x(i,1)=1, so we confirm

y(i,j)=1min{y(i,j1),y(i1,j1),y(i1,j2)}=1min{1,0,1}=1.y(i,j)=1-\min\{y(i,j-1),y(i-1,j-1),y(i-1,j-2)\}=1-\min\{1,0,1\}=1.

If i>0i>0 is even and 2d+1<j0-2d+1<j\leq 0 is even, then we know y(i,j)=x(i,0)=1y(i,j)=x(i,0)=1, so we confirm

y(i,j)=1min{y(i,j1),y(i1,j1),y(i1,j2)}=1min{1,1,0}=1.y(i,j)=1-\min\{y(i,j-1),y(i-1,j-1),y(i-1,j-2)\}=1-\min\{1,1,0\}=1.

Such verification can be completed for the seven edge cases to show that y(i,j)y(i,j) obeys Equation 24, and therefore Y𝒲AY^{\infty}\in\mathcal{W}^{A}.

Finally, we check for subperiods of YY. Note that as long as d>0d>0, there are exactly (n+1)(n+1) copies of the substring (01)d+1(01)^{d+1} present in YY, each at the beginning of a row. Additionally, the last row uniquely has length bb, meaning the instances of (01)d+1(01)^{d+1} are unequally spaced throughout YY. This prevents a sub-period of YY from occurring. ∎

7 Closing

We close the paper by setting up a few conjectures. First, we recall the observation that the converse of Proposition 2.10 holds for all (A,S)(A,S) where |A|3|A|\leq 3, and state it explicitly in a conjecture.

Conjecture 2.

If |A|3|A|\leq 3, then for all S{0,1}αS\in\{0,1\}^{\alpha}, let p=Per(A,S)p=\operatorname{Per}(A,S). Then if kp+xkp+x is an extension of AA for all k+k\in\mathbb{N}_{+} and xAx\in A, then PrePer(A,S)=0\operatorname{PrePer}(A,S)=0.

It suffices to check the case k=1k=1. If S=S=\emptyset this is precisely the converse of Proposition 2.10; otherwise the converse is not true.

The following conjecture is based on computer simulations of A([200]3)A\in{[200]\choose 3}. It provides a very limited characterization of the general {a,b,c}\{a,b,c\} case but provides an example of its complex behavior.

Conjecture 3.

Suppose A={a,b,c}A=\{a,b,c\} with 1<a<b<c1<a<b<c. Use the division algorithm to obtain the following variables:

b\displaystyle b =qa+r\displaystyle=q\ a+r
c\displaystyle c =qc(a+b)+rc\displaystyle=q_{c}(a+b)+r_{c} rc\displaystyle r_{c} =qa(2a)+ra\displaystyle=q_{a}(2a)+r_{a}
ca\displaystyle c-a =qc(a+b)+rc\displaystyle=q_{c}^{\prime}(a+b)+r_{c}^{\prime} rc\displaystyle r_{c}^{\prime} =qa(2a)+ra\displaystyle=q_{a}^{\prime}(2a)+r_{a}^{\prime}

Then Per(A)=b+c\operatorname{Per}(A)=b+c and PrePer(A)=0\operatorname{PrePer}(A)=0 if and only if one of the following holds:

  1. (i)

    qq is even and rc>0r_{c}^{\prime}>0, rarr_{a}^{\prime}\leq r, and 2qaq2q_{a}^{\prime}\leq q, and if 2qa=q2q_{a}^{\prime}=q then ra2rar_{a}^{\prime}\leq 2r-a.

  2. (ii)

    qq is odd and r0r\neq 0, rraar\leq r_{a}\leq a, and if qa=0q_{a}=0 then ra<ar_{a}<a.

  3. (iii)

    qq is odd and r=0r=0, and raar_{a}\neq a

The following conjecture has been verified for all A([25]3)A\in{[25]\choose 3}, for all seeds SS. Together with Conjecture 1 these are a strengthening of a conjecture by Althöfer and Bültermann in [1, (i)].

Conjecture 4.

If A={a,b,c}A=\{a,b,c\} with a<b<ca<b<c, and if gcd(a,b,c)=1\gcd(a,b,c)=1, then for all seeds S{0,1}αS\in\{0,1\}^{\alpha}, we have Per(A,S)<c2\operatorname{Per}(A,S)<c^{2}.

This would imply that the construction in Theorem 6.2 can only occur if AA has a greatest common divisor. It would also provide the general bound that if g=gcd(a,b,c)g=\gcd(a,b,c) and c~=c/g\tilde{c}=c/g, then for all seeds SS, Per(A,S)c~2g\operatorname{Per}(A,S)\leq\tilde{c}^{2g}, which is 𝒪(e2c/e)\mathcal{O}(e^{2c/e}) in the worst case but ordinarily much less than (min(a+b,c)+1)2c3(\min(a+b,c)+1)2^{c-3}, the bound derived in Theorem 2.4.

From computer simulations of A([25]3)A\in{[25]\choose 3} with gcdA=1\gcd A=1, we note that for all seeds SS, if the period is super-linear, i.e. Per(A,S)>2c\operatorname{Per}(A,S)>2c, then (a+b)c(a+b)\mid c, with the following eight exceptions. These sets have max(𝒫A)>2α\max(\mathcal{P}^{A})>2\alpha, with example seeds given.

Per({11,16,20},(01)214012)\operatorname{Per}(\{11,16,20\},(01)^{2}1^{4}01^{2}) =61=61
Per({3,11,21},0210120)\operatorname{Per}(\{3,11,21\},0^{2}101^{2}0) =61=61
Per({7,17,23},(010)2012)\operatorname{Per}(\{7,17,23\},(010)^{2}01^{2}) =73=73
Per({10,21,23},021014)\operatorname{Per}(\{10,21,23\},0^{2}101^{4}) =78=78
Per({5,11,24},0120312010)\operatorname{Per}(\{5,11,24\},01^{2}0^{3}1^{2}010) =65=65
Per({11,16,25},012010214)\operatorname{Per}(\{11,16,25\},01^{2}010^{2}1^{4}) =56=56
Per({16,21,25},02(1013)2012)\operatorname{Per}(\{16,21,25\},0^{2}(101^{3})^{2}01^{2}) =61=61
Per({13,23,25},0212010215)\operatorname{Per}(\{13,23,25\},0^{2}1^{2}010^{2}1^{5}) =83=83

A characterization of these sets may relate to the solution to Conjecture 1 and/or 4.

Acknowledgement

IM was supported by NKFIH grant K132696. The project is a continuation of the work done at the 2022 Spring semester at Budapest Semesters in Mathematics. Both authors thank to Mariam Wael Abu-Adas for participating in the very early phase of the research work at the BSM leading to the results presented in this paper. Both authors would like to thank the BSM for running the program.

References

  • [1] Ingo Althöfer and Jörg Bültermann. Superlinear period lengths in some subtraction games. Theoretical Computer Science, 148(1):111–119, 1995.
  • [2] P. T. Bateman, Jeffrey Kalb, and Allen Stenger. A limit involving least common multiples: 10797. Am. Math. Mon., 109:393–394, 2002.
  • [3] Elwyn R Berlekamp, John H Conway, and Richard K Guy. Winning ways for your Mathematical Plays, volume 1. AK Peters, 2001.
  • [4] Elwyn R Berlekamp, John H Conway, and Richard K Guy. Winning ways for your Mathematical Plays, volume 3. AK Peters/CRC Press, 2004.
  • [5] Raymond Bisdorff and Jean-Luc Marichal. Counting non-isomorphic maximal independent sets of the n-cycle graph. Journal of Integer Sequences, 11, 02 2007.
  • [6] Grant Cairns and Nhan Bao Ho. Ultimately bipartite subtraction games. Australas. J Comb., 48:213–220, 2010.
  • [7] Zoltán Füredi. The number of maximal independent sets in connected graphs. J. Graph Theory, 11(4):463–470, 1987.
  • [8] P. M. Grundy. Mathematics and games. Eureka, 2:6–8, 1939.
  • [9] Nhan Bao Ho. On the expansion of three-element subtraction sets. Theoretical Computer Science, 582:35–47, 2015.
  • [10] OEIS Foundation Inc. The On-Line Encyclopedia of Integer Sequences, 2023. Published electronically at http://oeis.org.
  • [11] R. P. Sprague. Über mathematische kampfspiele. Tohoku Mathematical Journal (in German), 41:438–444, 1936.