\documentclass[12pt]{article}
\textwidth= 6.25in
\textheight= 9.0in
\topmargin = -10pt
\evensidemargin=10pt
\oddsidemargin=10pt
\headsep=25pt
\parskip=10pt
\font\smallit=cmti10
\font\smalltt=cmtt10
\font\smallrm=cmr9 

\usepackage{amsthm,latexsym,amssymb}
%\input epsf.tex
\newtheorem{proposition}{Proposition}
\newtheorem{lemma}{Lemma}
\newtheorem{corollary}{Corollary}
\newtheorem{theorem}{Theorem}
\newtheorem{definition}{Definition}
\newtheorem{example}{Example}
\newenvironment{pf}{\medskip\noindent{\it Proof}.}{}
\font\amsx=msam10
\font\amsy=msbm10
\font\sfa=cmss10 scaled\magstep1
\def\IZ{\mathbb{Z}}
%\def\IZ{\hbox{\amsy\char'132}}
\def\bqed{\quad\hbox{\amsx\char'004}}
\def\mex{\mathop{\rm mex}\nolimits}

\begin{document} 
\vspace*{-60pt}
\centerline{\smalltt INTEGERS:
 \smallrm ELECTRONIC JOURNAL OF COMBINATORIAL NUMBER THEORY \smalltt 4
(2004), \#G06}
\vskip 30pt
\begin{center}
\uppercase{\bf New games related to old and new sequences}
\vskip 20pt
{\bf Aviezri S. Fraenkel\footnote{\tt 
http://www.wisdom.weizmann.ac.il/$\sim$fraenkel}}\\
{\smallit Department of Computer Science and Applied
Mathematics, Weizmann Institute of Science, Rehovot 76100, Israel}\\
 {\tt fraenkel@wisdom.weizmann.ac.il}\\ 
\vskip 30pt
\centerline{\smallit Received: 2/19/04, 
Revised: 11/4/04, Accepted: 11/7/04, Published: 11/9/04}
\vskip 30pt 
\end{center}

\centerline{\bf Abstract}

\noindent
We define an infinite class of 2-pile subtraction games, where the
amount that can be subtracted from both piles simultaneously, is a
function $f$ of the size of the piles. Wythoff's game is a special
case. For each game, the 2nd player winning positions are a pair of
complementary sequences, some of which are related to well-known
sequences, but most are new. The main result is a theorem giving
necessary and sufficient conditions on $f$ so that the sequences
are 2nd player winning positions. Sample games are presented,
strategy complexity questions are discussed, and possible further
studies are indicated.

\noindent
{\bf Keywords}: 2-pile subtraction games, complexity of games,
integer sequences 

\pagestyle{myheadings}
\markright{\smalltt INTEGERS: \smallrm ELECTRONIC JOURNAL OF COMBINATORIAL
 NUMBER THEORY \smalltt 4 (2004), \#G06\hfill}

\thispagestyle{empty} 
\baselineskip=15pt 
\vskip 30pt 


\section*{\normalsize 1. Introduction}
%{\it Dominican International Forwarding\/} is the finest international
%transportation company, according to its web site (in Spanish) at
%http://www.dif.com.do . (An optional Google rendition confirms once
%again that mechanical translation is still in its infancy.) What's
%the connection of DIF to games?
%
%While pondering this question, let's introduce our first game:
%
%${\mathbf G_1}$ {\bf from dif.com.do}\medskip
We begin with an example. Given two piles of tokens $(x,y)$ of
sizes $x$, $y$, with $0\le x\le y<\infty$, two players alternate
removing tokens from the piles according to the following two
rules. A player, at his turn, can choose precisely one of them, as
he sees fit.
\begin{itemize}
\item[(a)]~Remove any positive number of tokens from a single pile,
possibly the entire pile.
\item[(b)]~Remove a positive number of tokens from each pile, say
$k,\ell$, so that $|k-\ell|$ isn't too large with respect to the position
$(x_1,y_1)$ moved to from $(x_0,y_0)$, namely, $|k-\ell|<x_1+1$
$\ (x_1\le y_1)$.
\end{itemize}
The player making the move after which both piles are empty (a {\it leaf\/}
of the game), wins; the opponent loses. Thus, $(11,15)\rightarrow (3,4)$
or to $(2,4)$ are legal moves, but $(11,15)\rightarrow (2,3)$ or to $(0,3)$
are not. The position $(0,0)$ is the only leaf of this and our following
games.

For any acyclic combinatorial game without ties, such as ${\mathbf G_1}$,
a position $u=(x,y)$ is labeled $N$ ({\it Next\/} player win) if
the player moving from $u$ has a winning strategy; otherwise it's a
$P$-position ({\it Previous\/} player win). Denote by ${\cal P}$ the
set of all $P$-positions, by ${\cal N}$ the set of all $N$-positions,
and by $F(u)$ the set of all game positions that are reachable from
%(direct) {\it followers\/} or {\it options\/}
$u$ in a single move. It is easy to see that for any acyclic game,
\begin{eqnarray}
u\in {\cal P}\quad\mbox{ if and only if }\quad F(u)\subseteq {\cal N}\ ,\\
u\in {\cal N}\quad\mbox{ if and only if }\quad F(u)\cap {\cal P}\ne
\emptyset\ .
\end{eqnarray}%\indent
Indeed, player~I, beginning from an $N$-position, will move to a $P$-position,
which exists by (2), and player~II has no choice but to go to an
$N$-position, by (1). Since the game is finite and acyclic, player~I
will eventually win by moving to a leaf, which is clearly a $P$-position.

The partitioning of the game's positions into the sets ${\cal P}$
and ${\cal N}$ is unique for every acyclic combinatorial game
without ties.

Let $\IZ$ denote the set of integers. Let $S\subset\IZ_{\ge 0}$,
$S\ne\IZ_{\ge 0}$, and $\overline{S}=\IZ_{\ge 0}\setminus S$. The
{\it minimum excluded value\/} of $S$ is
$$\mex S=\min\overline{S} =\mbox{\ least nonnegative integer not in\ } S.$$
Note that mex of the empty set is 0.

Table~1 portrays the first few $P$-positions $(a_n,b_n)$ of
${\mathbf G_1}$. The reader is encouraged to verify that the first
few entries of the table are indeed $P$-positions of the game. For
a technical reason we put $b_{-1}=-1$. In \S4 we prove, as a
simple corollary to a considerably more general result,

\begin{table}
\begin{center}
\setlength{\tabcolsep}{4.2pt}
\centerline{\small Table 1. The first few $P$-positions for ${\mathbf G_1}$.}
\bigskip
\begin{tabular}{|r|rrrrrrrrrrrrrrrrr|}
\hline
&&&&&&&&&&&&&&&&&\\
$n$ &0 &1 &2 &3 &4 &5 &6 &7 &8 &9 &10 &11 &12 &13 &14 &15 &16 \\
&&&&&&&&&&&&&&&&&\\
\hline
&&&&&&&&&&&&&&&&&\\
$a_n$ &0 &1 &3 &4 &5 &7 &8 &9 &10 &12 &13 &14 &15 &16 &18 &19 &20 \\
&&&&&&&&&&&&&&&&&\\
$b_n$ &0 &2 &6 &11 &17 &25 &34 &44 &55 &68 &82 &97 &113 &130 &149 &169 &190 \\
&&&&&&&&&&&&&&&&&\\
\hline
\end{tabular}
%\caption{}
%\par\bigskip
%\centerline{Table 1}
\end{center}
\end{table}

\begin{theorem}
For ${\mathbf G_1}$, $\ {\cal P}=\cup_{i=0}^{\infty} (a_i,b_i)$,
where, for all $n\in\IZ_{\ge 0}$,
\begin{eqnarray}
a_n=\mex\left\{\{a_i : 0\le i<n\}\ \bigcup\ \{b_i : 0\le i<n\}\right\}, \\
b_n=b_{n-1}+a_n+1.
\end{eqnarray}
\end{theorem}

%In (3), and in the sequel, the comma inside the set stands for union:
%$A_i,B_i=A_i\cup B_i$.
The game ${\mathbf G_1}$ is a member of the
following new family of combinatorial games defined on two piles of
finitely many tokens, with two types of moves: a move of type~(a), and a
more general move of type~(b), namely, $|k-\ell|$ depends on the present
and next position. Denote the present position by $(x_0,y_0)$ and the
position moved to by $(x_1,y_1)$. We then require,
\begin{eqnarray}
|(y_0-y_1)-(x_0-x_1)|=|(y_0-x_0)-(y_1-x_1)|<f(x_1,y_1,x_0),
\end{eqnarray}
where $f$ is a real {\it constraint function\/} depending on $x_1,y_1,x_0$.
If also $(y_0-x_0)\ge (y_1-x_1)$, then requirement (5) becomes
$y_0<f(x_1,y_1,x_0)+y_1-x_1+x_0$. The type~(b)
move defined for ${\mathbf G_1}$ is the special case $f=x_1+1$.
%and (4) is implied for this special case by $y_0<y_1+x_0+1$.
Here are descriptions of two additional games.

${\mathbf G_2}$ is the same as ${\mathbf G_1}$, except that in
(b), $|k-\ell|<x_1+1$ is replaced by $|k-\ell|<x_0-x_1$.

${\mathbf G_3}$ is the same as ${\mathbf G_1}$, except that in
(b), $|k-\ell|<x_1+1$ is replaced by $|k-\ell|<y_1-x_1+1$.

The first few $P$-positions for ${\mathbf G_2}$ and ${\mathbf G_3}$
are listed in Tables~2 and 3 respectively. In \S4 we also prove, as
a corollary to the master theorem (Theorem~3),

\begin{table}
\begin{center}
\setlength{\tabcolsep}{5.0pt}
\centerline{\small Table 2. The first few $P$-positions for ${\mathbf G_2}$.}

\begin{tabular}{|r|rrrrrrrrrrrrrrrrr|}
\hline
&&&&&&&&&&&&&&&&&\\
$n$ &0 &1 &2 &3 &4 &5 &6 &7 &8 &9 &10 &11 &12 &13 &14 &15 &16 \\
&&&&&&&&&&&&&&&&&\\
\hline
&&&&&&&&&&&&&&&&&\\
$a_n$ &0 &1 &3 &4 &5 &7 &9 &11 &12 &13 &15 &16 &17 &19 &20 &21 &23 \\
&&&&&&&&&&&&&&&&&\\
$b_n$ &0 &2 &6 &8 &10 &14 &18 &22 &24 &26 &30 &32 &34 &38 &40 &42 &46 \\
&&&&&&&&&&&&&&&&&\\
\hline
\end{tabular}
%\caption{}
%\par\bigskip
%\centerline{Table 1}
\end{center}
\end{table}

\begin{table}
\begin{center}
\setlength{\tabcolsep}{2.1pt}
\centerline{\small Table 3. The first few $P$-positions for ${\mathbf G_3}$.}
\bigskip
\begin{tabular}{|r|rrrrrrrrrrrrrrrrr|}
\hline
&&&&&&&&&&&&&&&&&\\
$n$ &0 &1 &2 &3 &4 &5 &6 &7 &8 &9 &10 &11 &12 &13 &14 &15 &16 \\
&&&&&&&&&&&&&&&&&\\
\hline
&&&&&&&&&&&&&&&&&\\
$a_n$ &0 &1 &3 &4 &5 &7 &8 &9 &10 &12 &13 &14 &15 &16 &17 &18 &19 \\
&&&&&&&&&&&&&&&&&\\
$b_n$ &0 &2 &6 &11 &20 &38 &71 &136 &265 &523 &1036 &2061 &4110
&8207
&16400 &32785 &65554 \\
&&&&&&&&&&&&&&&&&\\
\hline
\end{tabular}
\end{center}
\end{table}

\begin{theorem}
For ${\mathbf G_2}$ and ${\mathbf G_3}$, $\ {\cal
P}=\cup_{i=0}^{\infty} (a_i,b_i)$, where, for all $n\in\IZ_{\ge
0}$, $a_n$ is given by {\rm (3)}. For ${\mathbf G_2}$$:$
$b_n=2a_n$; and for ${\mathbf G_3}$$:$ $b_0=0$, and for
$n\in\IZ_{\ge 1}$, $\ b_n=a_n+2^n-1$.
%\begin{eqnarray*}
%A_n=\mex\{(A_i,B_i) : 0\le i<n\}, \\
%B_n=B_{n-1}+A_n+1.
%\end{eqnarray*}
\end{theorem}

Each of our games is associated with a pair of complementary
sequences $$A=\{a_i\}_{i=1}^{\infty},\qquad
B=\{b_i\}_{i=1}^{\infty}.$$ A special case is the well-known
(classical) Wythoff game \cite{Wyt1907}. See also \cite{BCG1982},
\cite{BlFr1990}, \cite{Con1959}, \cite{Cox1953}, \cite{DFP1999},
\cite{Fra1982}, \cite{Fra1984}, \cite{FrBo1973}, \cite{FrOz1998},
\cite{Lan2002}, \cite{Sil1976}, \cite{Sil1977}, \cite{YaYa1967}.
In fact, the classical Wythoff game is the case
$f(x_1,y_1,x_0)=1$, and the generalization considered in
\cite{Fra1982} is the case $f(x_1,y_1,x_0)=t$ for any fixed
$t\in\IZ_{>0}$. Whereas the winning strategy of Wythoff's game is
associated with sequences related to algebraic integers of the
form $(2-t+\sqrt{t^2+4})/2$ (this is the golden section when
$t=1$), our games give rise to an infinity of sequences, some
well-known, but mostly new ones.

In \S2 we shall see that the pair of sequences of $P$-positions
associated with ${\mathbf G_1}$ is related to a
``self-generating'' sequence of Hofstadter (see Sloane
\cite{Slo1999}). In \S3 we indicate how the $P$-positions of
${\mathbf G_2}$ are related to another well-known sequence. The
central result appears in \S4, where a general theorem is
formulated and proved, that yields winning strategies for a large
class of 2-pile subtraction games. Roughly speaking it states that
for every 2-pile subtraction game, if its constraint function $f$
is ``positive'', ``monotone'' and ``semi-additive'', then it has
$P$-positions $(A, B)$, where $a_n$ satisfies (3), and $b_n$ has
an explicit form depending on $f$. In a complementary proposition
we show that positivity, monotonicity and semi-additivity are also
necessary, in the sense that if any one of them is dropped, then
there are constraint functions and their associated games $G$,
such that the positions claimed to be $P$-positions by the central
result, are not $P$-positions for these $G$. Theorems~1 and 2 are
then deduced as simple corollaries of the central result. In \S5
we give an assortment of sample games with their $P$-positions
that can be produced from the central theorem. Questions of
complexity and related issues are discussed in \S6. The epilogue
in \S7 wraps up with some concluding remarks and indications for
further study.
\vskip 30pt
\section*{\normalsize 2. The G\"{o}del, Escher, Bach Connection}

On p.~73 of Hofstadter's famous book \cite{Hof1979} the reader is
asked to characterize the following sequence:
\begin{center}
$B'_{n\ge 0}=\{1,\ 3,\ 7,\ 12,\ 18,\ 26,\ 35,\ 45,\ 56,\dots\}$.
\end{center}

Answer: the sequence $\{2,\ 4,\ 5,\ 6,\ 8,\ 9,\ 10,\ 11,\dots\}$
constitutes the set of differences of consecutive terms of
$B'_{n\ge 0}$, as well as the complement with respect to
$\IZ_{>0}$ of $B'_{n\ge 0}$. For our purposes it is convenient to
preface 0 to the latter sequence, so we define
\begin{center}
$A'_{n\ge 0}=\{0,\ 2,\ 4,\ 5,\ 6,\ 8,\ 9,\ 10,\ 11,\dots\}$,
\end{center}
which is the complement with respect to $\IZ_{\ge 0}$ of $B'_{n\ge
0}$. Now $a'_{10}=\mex\{a'_i, b'_i : 0\le i<10\}=13$, so
$b'_{10}=56+13=69$. We see that in general, for all $n\in\IZ_{\ge
0}$,
\begin{eqnarray}
a'_n=\mex\left\{\{a'_i : 0\le i<n\}\ \bigcup\ \{b'_i : 0\le
i<n\}\right\},
\end{eqnarray}
which has the form (3), and
\begin{eqnarray}
b'_{-1}=1,\qquad b'_n=b'_{n-1}+a'_n,
\end{eqnarray}
which is similar to (4). Moreover, the following proposition shows
that there is a very close relationship between the $P$-positions
of the game ${\mathbf G_1}$ and Hofstadter's sequence $B'_{n\ge
0}$, namely, $b'_n$ exceeds $b_n$ by 1. This can be observed by
comparing the bottom row of Table~1 with $B'_{n\ge 0}$.
\begin{proposition}
$a'_n=a_n+1$ $\ (n\ge 1),\quad$ $b'_n=b_n+1$ $\ (n\ge 0)$, where
$a'_n$, $b'_n$ are given by {\rm (6), (7)} respectively, and
$a_n$, $b_n$ by {\rm (3), (4)} respectively.
\end{proposition}
\begin{pf}
We see that the assertions are true for small $n$. Suppose they hold
for all $i\le n$. Then
\begin{center}
$a'_{n+1}=\mex\{a'_i, b'_i : 0\le i\le n\}= \mex\{0,a_i+1, b_i+1 :
0\le i\le n\}$.
%=1+\mex\{A_i, B_i : 0\le i\le n\}=A_{n+1}+1$.
\end{center}
Let $S'_n=\{0,a_i+1, b_i+1 : 0\le i\le n\}$, $S_n=\{a_i,b_i : 0\le
i\le n\}$. If, say, the integer interval $[0,k]$ is in $S_n$ for
some $k\in\IZ_{>0}$ and $k+1\not\in S_n$, then the integers in the
interval $[0,k+1]$ are in $S'_n$ and $k+2\not\in S'_n$. It follows
that $\mex S'_n=a_{n+1}+1$. Also,
$b'_{n+1}=b'_n+a'_{n+1}=b_n+1+a_{n+1}+1=b_{n+1}+1$.\hfill $\Box$
\end{pf}

Thus the $P$-positions of $G_1$ constitute an ``offset by 1'' of
the Hofstadter sequence and its complement.%, that is, $b_{n+1}-b_n=a_{n+1}+1$. So
%$a_n+1$ is the difference and $a_n$ the complement of $b_n$.
\vskip 30pt
\section*{\normalsize 3. Prouhet-Thue-Morse}

It is not hard to see that the sequence $A_{n\ge 1}$ of ${\mathbf
G_2}$ contains precisely all positive integers whose binary
representation ends in an even number of zeros.
%(Because of this,
%${\mathbf G_2}$ originates from even.com: ``www.even.com is the
%best place to find information and sources for even'', it says on
%its webpage.)
The sequence $A_{n\ge 1}$ is also lexicographically minimal with
respect to the property that the parity of the number of 1's in
the binary expansion alternates. Furthermore, it is
lexicographically minimal with respect to the property that the
complement is the double of the sequence. If $m$ appears in $A$,
then $2m$ appears in $B$. In particular, $B_{n\ge 1}$ contains
precisely all positive integers whose binary representation ends
in an odd number of zeros \cite{CSH1972}. The sequence
\begin{eqnarray*}
C_n&=&0^{a_1-a_0}1^{a_2-a_1}0^{a_3-a_2}\dots
0^{a_{2n+1}-a_{2n}}1^{a_{2n+2}-a_{2n+1}}\dots \\
&=&011010011001011010010\dots,
\end{eqnarray*}
is the Prouhet-Thue-Morse sequence, which arises in many different
areas of mathematics. See the charming paper \cite{AlSh1999},
which also contains the sequence $A$, for many further properties
of these sequences.
\vskip 30pt
\section*{\normalsize 4. A Master Theorem}

The three previously described games ${\mathbf G_1}$, ${\mathbf G_2}$,
${\mathbf G_3}$, are members of an infinite family of games that
we now formulate. We will then provide a general winning strategy for
this family of games and prove its validity.

\noindent
{\bf General 2-pile subtraction games}

Given two piles of tokens $(x,y)$ of sizes $x$, $y$, with $0\le
x\le y<\infty$. %whose $P$-positions are ${\cal P}=\cup_{i=0}^{\infty} (a_i,b_i)$.
Two players alternate removing
tokens from the piles:

(aa)~Remove any positive number of tokens from a single pile,
possibly the entire pile.

(bb)~Remove a positive number of tokens from each pile, say
$k,\ell$, so that $|k-\ell|$ isn't too large with respect to the position
$(x_1,y_1)$ moved to from $(x_0,y_0)$, namely, $|k-\ell|<f(x_1,y_1,x_0)$;
equivalently:
\begin{eqnarray}
|(y_0-y_1)-(x_0-x_1)|=|(y_0-x_0)-(y_1-x_1)|<f(x_1,y_1,x_0),
\end{eqnarray}
where the constraint function $f(x_1,y_1,x_0)$ is integer-valued
and satisfies:
\begin{itemize}
\item Positivity:
%\begin{eqnarray*}
$$f(x_1,y_1,x_0)>0\ \ \forall y_1\ge x_1\ge 0\ \ \forall x_0>x_1.$$
%\end{eqnarray*}
\item Monotonicity:
%\begin{eqnarray*}
$$x'_0<x_0\Longrightarrow f(x_1,y_1,x'_0)\le f(x_1,y_1,x_0).$$
%\end{eqnarray*}
\item Semi-additivity (or generalized triangle inequality) on the
$P$-positions, namely: for all $n>m\ge 0$,
%\begin{eqnarray*}
$$\sum_{i=0}^m f(a_{n-1-i},b_{n-1-i},a_{n-i})\ge f(a_{n-m-1},b_{n-m-1},a_n).$$
%\end{eqnarray*}
\end{itemize}
The player making the move after which both piles are empty wins;
the opponent loses.

In view of (8), positivity is a natural condition. Without positivity,
a move of type~(bb) isn't even possible. Monotonicity appears to be a
minimal requirement to enforce positivity. Semi-additivity is a convenient
condition to have, and many functions are semi-additive. %It turns out
%that though semi-additivity is defined on the $P$-positions, checking
%whether it holds or not doesn't normally require knowledge of the
%$P$-positions themselves; their positivity alone suffices.
Whereas positivity and monotonicity are defined on any game
positions, semi-additivity is defined on the candidate
$P$-positions. All three conditions are applied to $P$-positions.
If all three are satisfied, then the candidates are indeed
$P$-positions, as enunciated in Theorem~3 below. The function f
depends on three independent variables $x_1, y_1, x_0$ or
$a_{n-1}, b_{n-1}, a_n$, and the dependent variable $b_n$ --- so
that $(a_n, b_n)\in {\cal P}$ --- is then computed by $f$.

Note that ${\mathbf G_1}$, ${\mathbf G_2}$, ${\mathbf G_3}$
clearly satisfy positivity and monotonicity; ${\mathbf G_1}$ and
${\mathbf G_3}$, in whose functions $f$ there is no $a_n$, are
clearly semi-additive; and ${\mathbf G_2}$ is semi-additive with
equality. (See also the proof of Theorems~1 and 2 at the end of
this section.)

\begin{theorem}
Let ${\cal S}=\cup_{i=0}^{\infty} (a_i,b_i)$, where, for all
$n\in\IZ_{\ge 0}$, $a_n$ is given by {\rm (3)}, $b_0=0$, and for
all $n\in\IZ_{>0}$,
\begin{eqnarray}
b_n=f(a_{n-1},b_{n-1},a_n)+b_{n-1}+a_n-a_{n-1}.
\end{eqnarray}
If $f$ is positive, monotone and semi-additive, then ${\cal S}$ is
the set of $P$-positions of a general {\rm 2}-pile subtraction
game with constraint function $f$, and the sequences $A$, $B$
share the following common features: $(i)$ they partition
$\IZ_{\ge 1}$$;$ $(ii)$ $b_{n+1}-b_n\ge 2$ for all $n\in\IZ_{\ge
0}$$;$ $(iii)$ $a_{n+1}-a_n\in\{1,2\}$ for all $n\in\IZ_{\ge 0}$.
\end{theorem}

\begin{pf}
The definition of $a_n$ implies directly,
\begin{eqnarray}
a_n>a_{n-1}
\end{eqnarray}
for all $n\in\IZ_{>0}$.
>From (9) we have, for all $n\in\IZ_{>0}$,
\begin{eqnarray}
&&b_n-b_{n-1}=f(a_{n-1},b_{n-1},a_n)+a_n-a_{n-1}, \\
&&b_n-a_n=f(a_{n-1},b_{n-1},a_n)+b_{n-1}-a_{n-1}.
\end{eqnarray}
Now $f(a_0,b_0,a_1)>0$ by positivity, so $b_1-b_0\ge 2$ by (10),
(11). Hence we get, by induction on $n$,
\begin{eqnarray}
b_n-b_m\ge 2 {\rm\ for\ all\ } n>m\ge 0.
\end{eqnarray}
Similarly we get from (12),
\begin{eqnarray}
b_n-a_n>b_m-a_m\ge 0 {\rm\ for\ all\ } n>m\ge 0.
\end{eqnarray}
%Let $A=\cup_{n=1}^{\infty} A_n$ and $B=\cup_{n=1}^{\infty} B_n$.
Now $A$ and $B$ are {\it complementary\/} sets of integers, i.e.,
$A\cup B=\IZ_{\ge 1}$ (by (3)), and $A\cap B=\emptyset$. Indeed,
if $a_n=b_m$, then $n>m$ implies that $a_n$ is the mex of a set
containing $b_m=a_n$, a contradiction to the mex definition; and
$1\le n\le m$ is impossible since
\begin{eqnarray*}
b_m&=&f(a_{m-1},b_{m-1},a_m)+b_{m-1}+a_m-a_{m-1} \\
&\ge&f(a_{m-1},b_{m-1},a_n)+b_{n-1}+a_n-a_{n-1} \\
&&{\rm\ \left(by\ (10),\ (14)\ and\ monotonicity\right)} \\
&>&a_n\ ({\rm by\ positivity}).
\end{eqnarray*}
Since $b_n-b_{n-1}\ge 2$ for all $n\ge 1$ by (13), and since $A$
and $B$ are complementary,
\begin{eqnarray}
a_n-a_{n-1}\in\{1,2\}
\end{eqnarray}
for all $n\in\IZ_{>0}$.
%Denote by ${\cal P'}$ the set of all positions $(A_n,B_n)$ satisfying
%(3) and (9),
For the remainder of the proof it is useful to denote the set ${\cal S}$
defined in the statement of the theorem by ${\cal P'}$. Also
let ${\cal N'}=\IZ_{\ge 0}\setminus {\cal P'}$. For
showing that ${\cal P'}={\cal P}$ and ${\cal N'}={\cal N}$, it
evidently suffices to show two things:
\begin{itemize}
\item[I.]~Every move from any $(a_n,b_n)\in{\cal P'}$ results in
a position in the complement ${\cal N'}$.
\item[II.]~From every position $(x,y)$ in the complement ${\cal N'}$,
there is a move to some $(a_n,b_n)\in {\cal P'}$.
\end{itemize}
(It is useful to note that these two conditions are also necessary:
(1) implies that {\it all\/} positions reachable in one move from a
$P$-position are $N$-positions; whereas (2) shows that at least one
$P$-position is reachable in one move from an $N$-position.)

I.~A move of type~(aa) from $(a_n,b_n)\in{\cal P'}$ has the form
$(x,b_n)$ or $(a_n,y)$ $\ (x<a_n,\ y<b_n)$. Both are in ${\cal
N'}$ since the sequences $A$ and $B$ are strictly increasing.
Suppose there is a move of type~(bb): $(a_n,b_n)\rightarrow
(a_j,b_j)\in {\cal P'}$. Then $j<n$. Note that
\begin{eqnarray*}
&&|(b_n-b_j)-(a_n-a_j)| \\
&=&|(b_n-a_n)-(b_j-a_j)|=(b_n-a_n)-(b_j-a_j)
\end{eqnarray*}
by (14). By iterating (9) we have,
\begin{eqnarray*}
&&(b_n-a_n)-(b_j-a_j) \\
&&=f(a_{n-1},b_{n-1},a_n)+(b_{n-1}-a_{n-1})-(b_j-a_j) \\
&&=f(a_{n-1},b_{n-1},a_n)+f(a_{n-2},b_{n-2},a_{n-1}) \\
&&\hspace{3.34cm}+\ (b_{n-2}-a_{n-2})-(b_j-a_j)\\
&&\vdots\\
&&=\sum_{i=0}^{n-j-1} f(a_{n-i-1},b_{n-i-1},a_{n-i})\ge
f(a_j,b_j,a_n),
\end{eqnarray*}
where the inequality follows from semi-additivity. Thus
$$|(b_n-b_j)-(a_n-a_j)|\ge f(a_j,b_j,a_n),$$ contradicting
condition~(bb).

II.~ Let $(x,y)\in{\cal N'}$ $\ (0\le x\le y)$. Since $A$ and $B$
are complementary, every $n\in\IZ_{>0}$ appears exactly once in
exactly one of $A$ and $B$. Therefore we have either $x=b_n$ or
else $x=a_n$ for some $n\ge 0$.
(i)~$x=b_n$. Then move $y\rightarrow a_n$. This is always possible
since if $n=0$, then $y>a_0=b_0$; whereas $a_n<b_n$ for $n\ge 1$
by (14).

(ii)~$x=a_n$. If $y>b_n$, move $y\rightarrow b_n$. So suppose that
$a_n\le y<b_n$. %Suppose first $y=a_n$.
Then $n\ge 1$.
%So we may suppose $A_n<y<B_n$.
For any $m\in\{0,\dots,n-1\}$
we have by (9) and by monotonicity,
\begin{eqnarray*}
(b_{m+1}-a_{m+1})-(b_m-a_m)
&=&f(a_m,b_m,a_{m+1}) \\
&\le& f(a_m,b_m,a_n).
\end{eqnarray*}
Thus $b_m-a_m+f(a_m,b_m,a_n)\ge b_{m+1}-a_{m+1}$. Therefore the
intervals $[b_m-a_m,\ b_m-a_m+f(a_m,b_m,a_n))$ (closed on the
left, open on the right) cover $\IZ_{\ge 0}$ for $m\ge 0$. Hence
\begin{eqnarray}
y-a_n\in [b_m-a_m,\ b_m-a_m+f(a_m,b_m,a_n))
\end{eqnarray}
for a smallest $m\in\IZ_{\ge 0}$. We then move $(x,y)\rightarrow
(a_m,b_m)$. This move is legal, since:
\begin{itemize}
\item $m<n$. Indeed, $y-a_n<b_n-a_n=f(a_{n-1},b_{n-1},a_n)+b_{n-1}-a_{n-1}$.
Thus $m\le n-1$ by (16).
\item $y>b_m$. By (16), $y-a_n\ge b_m-a_m$. Hence
$y-b_m\ge a_n-a_m>0$.
\item The move satisfies (bb):
\begin{eqnarray*}
|(y-b_m)-(x-a_m)|&=&|(y-a_n)-(b_m-a_m)| \\
&=&(y-a_n)-(b_m-a_m)
\end{eqnarray*}
where the last equality follows from (16) and our choice of $m$.
We thus have
$|(y-a_n)-(b_m-a_m)|=(y-a_n)-(b_m-a_m)<f(a_m,b_m,a_n)$ by
(16).\hfill $\Box$
\end{itemize}\end{pf}

We now show that if any of the three conditions of Theorem~3 is
dropped, then there are games for which its conclusion fails.

\begin{proposition}
There exist $2$-pile subtraction games with constraint functions
$f$ which lack precisely one of positivity, monotonicity or
semi-additivity, such that ${\cal S}\ne {\cal P}$, where ${\cal
S}=\cup_{i=0}^{\infty} (a_i,b_i)$, and $a_i$ satisfies $(3)$
$(i\in\IZ_{\ge 0})$; $b_0=0$, $b_i$ satisfies $(9)$
$(i\in\IZ_{>0})$.
\end{proposition}

\begin{pf}
Consider the function $f(x_1,y_1,x_0)=(x_0-x_1)^2$. It is clearly
positive and monotone. However,
$(a_n-a_{n-1})^2+(a_{n-1}-a_{n-2})^2 <(a_n-a_{n-2})^2$, no matter
whether $a_n-a_{n-1}=a_{n-1}-a_{n-2}=1$ or otherwise, so $f$ is
not semi-additive. From (9) we get,
$b_n=b_{n-1}+(a_n-a_{n-1})(a_n-a_{n-1}+1)$, where $a_n$ satisfies
(3). The first few values of $(a_n, b_n)$ are depicted in Table~4.
Note that these are not $P$-positions: we can move
$(a_n,b_n)\rightarrow (a_i,b_i)$ in many ways; e.g.,
$(4,10)\rightarrow (0,0)$ satisfies (bb).
\begin{table}
\begin{center}
\setlength{\tabcolsep}{4.87pt}
\centerline{\small Table 4. The first few values of ${\cal S}$ for
$f=(x_0-x_1)^2$.}

\begin{tabular}{|r|rrrrrrrrrrrrrrrrr|}
\hline
&&&&&&&&&&&&&&&&&\\
$n$ &0 &1 &2 &3 &4 &5 &6 &7 &8 &9 &10 &11 &12 &13 & 14 &15 &16 \\
&&&&&&&&&&&&&&&&& \\
\hline
&&&&&&&&&&&&&&&&& \\
$a_n$ &0 &1 &3 &4 &5 &6 &7 &9 &11 &13 &15 &17 &18 &19 &20 &21 &23 \\
&&&&&&&&&&&&&&&&& \\
$b_n$ &0 &2 &8 &10 &12 &14 &16 &22 &28 &34 &40 &46 &48 &50 &52 &54 &60 \\
&&&&&&&&&&&&&&&&& \\
\hline
\end{tabular}
\end{center}
\end{table}


The function $f(x_1,y_1,x_0)=\lfloor(x_1+1)/x_0\rfloor+1$ is positive.
Since
$$\left(\left\lfloor\frac{a_{n-1}+1}{a_n}\right\rfloor+1\right)+
\left(\left\lfloor\frac{a_{n-2}+1}{a_{n-1}}\right\rfloor+1\right)>
\left\lfloor\frac{a_{n-2}+1}{a_n}\right\rfloor+1=1,$$ it is also
semi-additive. But it is not monotone. From (9),
$b_n=b_{n-1}-a_{n-1}+a_n+\lfloor(a_{n-1}+1)/a_n\rfloor+1$. The
first few values of ${\cal S}=\cup_{n=0}^{\infty} (a_n, b_n)$ are
shown in Table~5. The game-position $(4,7)\not\in{\cal S}$, but it
cannot be moved into ${\cal S}$. Hence ${\cal S}\not ={\cal P}$.
(Incidentally, note that the sequence $B$ consists of all
nonnegative multiples of 3.)
\begin{table}
\begin{center}
\setlength{\tabcolsep}{4.87pt}
\centerline{\small Table 5. The first few values of ${\cal S}$ for
$f=\lfloor(x_1+1)/x_0\rfloor+1$.}

\begin{tabular}{|r|rrrrrrrrrrrrrrrrr|}
\hline
&&&&&&&&&&&&&&&&&\\
$n$ &0 &1 &2 &3 &4 &5 &6 &7 &8 &9 &10 &11 &12 &13 & 14 &15 &16 \\
&&&&&&&&&&&&&&&&& \\
\hline
&&&&&&&&&&&&&&&&& \\
$a_n$ &0 &1 &2 &4 &5 &7 &8 &10 &11 &13 &14 &16 &17 &19 &20 &22 &23 \\
&&&&&&&&&&&&&&&&& \\
$b_n$ &0 &3 &6 &9 &12 &15 &18 &21 &24 &27 &30 &33 &36 &39 &42 &45 &48 \\
&&&&&&&&&&&&&&&&& \\
\hline
\end{tabular}
\end{center}
\end{table}

Lastly, consider
$f(x_1,y_1,x_0)=\left(1+(-1)^{y_1+1}\right)x_1/2$. We see easily
that $f$ is semi-additive, and it's trivially monotone. But
whenever $y_1$ is even, $f$ is not positive. We have,
$b_n=a_n+b_{n-1}-\left(1+(-1)^{b_{n-1}}\right)a_{n-1}/2$. Table~6
shows the first few ${\cal S}$-positions. These are not
$P$-positions: The position $(10,29)\not\in {\cal S}$, cannot be
moved into any position in ${\cal S}$.\hfill $\Box$

\begin{table}
\begin{center}
\setlength{\tabcolsep}{5.05pt}
\centerline{\small Table 6. The first few values of ${\cal S}$
for $f=\left(1+(-1)^{y_1+1}\right)x_1/2$.}

\begin{tabular}{|r|rrrrrrrrrrrrrrrrr|}
\hline
&&&&&&&&&&&&&&&&&\\
$n$ &0 &1 &2 &3 &4 &5 &6 &7 &8 &9 &10 &11 &12 &13 &14 &15 &16 \\
&&&&&&&&&&&&&&&&& \\
\hline
&&&&&&&&&&&&&&&&& \\
$a_n$ &0 &1 &2 &4 &5 &6 &8 &9 &10 &11 &14 &15 &16 &17 &18 &19 &20 \\
&&&&&&&&&&&&&&&&& \\
$b_n$ &0 &1 &3 &7 &12 &13 &21 &30 &31 &42 &45 &60 &61 &78 &79 &98 &99 \\
&&&&&&&&&&&&&&&&& \\
\hline
\end{tabular}
\end{center}
\end{table}
\end{pf}
\noindent
{\it Proof of Theorems 1 and 2}. The function
$f(x_1,y_1,x_0)=x_1+1$ is clearly positive. Monotonicity is
satisfied trivially. It's also clear that $f$ is semi-additive.
The function $f(x_1,y_1,x_0)=x_0-x_1$ is positive, since
$x_0>x_1$. It's also monotone. Since
$(a_{n+1}-a_n)+(a_n-a_{n-1})=a_{n+1}-a_{n-1}$, we see that $f$ is
semi-additive. Finally, the function $f(x_1,y_1,x_0)=y_1-x_1+1$ is
positive for all $x_1\le y_1$ and is trivially monotone. It's also
semi-additive. Thus by Theorem~3 we have for ${\mathbf G_1}$,
$b_n=a_{n-1}+1+b_{n-1}-a_{n-1}+a_n=b_{n-1}+a_n+1$, as stated in
Theorem~1. For ${\mathbf G_2}$, (9) implies,
$b_n=a_n-a_{n-1}+b_{n-1}-a_{n-1}+a_n =2a_n-2a_{n-1}+b_{n-1}=2a_n$,
where the last equality follows  by induction on $n$. For
${\mathbf G_3}$, $b_n=b_{n-1}-a_{n-1}+1+b_{n-1}-a_{n-1}+a_n=
2(b_{n-1}-a_{n-1})+a_n+1=a_n+2^n-1$. Again the last equality
follows by induction.\hfill $\Box$
\vskip 30pt
\section*{\normalsize 5. Further Sample Games}

For the examples below, we leave it to the reader to verify positivity,
monotonicity and semi-additivity of $f$. Some of these examples are
elaborated on in the next two sections.

\begin{example}
{\rm $f(x_1,y_1,x_0)=x_1-\lfloor(x_1+1)/x_0\rfloor+2$. Then
$b_n=b_{n-1}+a_n-\lfloor(a_{n-1}+1)/a_n\rfloor+2$. The first few
$P$-positions are depicted in Table~7.
\begin{table}
\begin{center}
\setlength{\tabcolsep}{4.2pt}
\centerline{\small Table 7. The first few values of ${\cal S}$ for
$f=x_1-\lfloor(x_1+1)/x_0\rfloor+2$.}

\begin{tabular}{|r|rrrrrrrrrrrrrrrrr|}
\hline
&&&&&&&&&&&&&&&&&\\
$n$ &0 &1 &2 &3 &4 &5 &6 &7 &8 &9 &10 &11 &12 &13 & 14 &15 &16 \\
&&&&&&&&&&&&&&&&& \\
\hline
&&&&&&&&&&&&&&&&& \\
$a_n$ &0 &1 &3 &4 &5 &6 &8 &9 &10 &11 &13 &14 &15 &16 &17 &19 &20 \\
&&&&&&&&&&&&&&&&& \\
$b_n$ &0 &2 &7 &12 &18 &25 &35 &45 &56 &68 &83 &98 &114 &131 &149 &170 &191 \\
&&&&&&&&&&&&&&&&& \\
\hline
\end{tabular}
\end{center}
\end{table}}
\end{example}

\begin{example}
{\rm $f(x_1,y_1,x_0)=x_0-x_1+2$. Then
$b_n=b_{n-1}+2(a_n-a_{n-1}+1)=2(a_n+n)$. See Table~8 for the first
few $P$-positions.
\begin{table}
\begin{center}
\setlength{\tabcolsep}{4.87pt}
\centerline{\small Table 8. The first few values of ${\cal S}$ for
$f=x_0-x_1+2$.}

\begin{tabular}{|r|rrrrrrrrrrrrrrrrr|}
\hline
&&&&&&&&&&&&&&&&&\\
$n$ &0 &1 &2 &3 &4 &5 &6 &7 &8 &9 &10 &11 &12 &13 & 14 &15 &16 \\
&&&&&&&&&&&&&&&&& \\
\hline
&&&&&&&&&&&&&&&&& \\
$a_n$ &0 &1 &2 &3 &5 &6 &7 &9 &10 &11 &13 &14 &15 &16 &17 &19 &20 \\
&&&&&&&&&&&&&&&&& \\
$b_n$ &0 &4 &8 &12 &18 &22 &26 &32 &36 &40 &46 &50 &54 &58 &62 &68 &72 \\
&&&&&&&&&&&&&&&&& \\
\hline
\end{tabular}
\end{center}
\end{table}}
\end{example}
\begin{example}
{\rm $f(x_1,y_1,x_0)=(-1)^{y_1}-(-1)^{x_1}+3$. Then
$b_n=b_{n-1}-a_{n-1}+a_n+(-1)^{b_{n-1}}-(-1)^{a_{n-1}}+3$. See
Table~9 for the first few $P$-positions.
\begin{table}
\begin{center}
\setlength{\tabcolsep}{4.75pt}
\centerline{\small Table 9. The first few values of ${\cal S}$ for
$f=(-1)^{y_1}-(-1)^{x_1}+3$.}

\begin{tabular}{|r|rrrrrrrrrrrrrrrrr|}
\hline
&&&&&&&&&&&&&&&&&\\
$n$ &0 &1 &2 &3 &4 &5 &6 &7 &8 &9 &10 &11 &12 &13 &14 &15 &16 \\
&&&&&&&&&&&&&&&&& \\
\hline
&&&&&&&&&&&&&&&&& \\
$a_n$ &0 &1 &2 &3 &5 &6 &7 &8 &9 &11 &12 &13 &15 &16 &17 &18 &19 \\
&&&&&&&&&&&&&&&&& \\
$b_n$ &0 &4 &10 &14 &21 &25 &27 &31 &33 &38 &44 &48 &55 &59 &61 &65 &67 \\
&&&&&&&&&&&&&&&&& \\
\hline
\end{tabular}
\end{center}
\end{table}}
\end{example}
\begin{example}
{\rm $f(x_1,y_1,x_0)=x_1\left(1+(-1)^{x_1}\right)+1$. This leads
to $b_n=b_{n-1}+(-1)^{a_{n-1}}a_{n-1}+a_n+1$. Table~10 exhibits
the first few $P$-positions.
\begin{table}
\begin{center}
\setlength{\tabcolsep}{4.35pt}
\centerline{\small Table 10. The first few values of ${\cal S}$ for
$f=x_1\left(1+(-1)^{x_1}\right)+1$.}

\begin{tabular}{|r|rrrrrrrrrrrrrrrrr|}
\hline
&&&&&&&&&&&&&&&&&\\
$n$ &0 &1 &2 &3 &4 &5 &6 &7 &8 &9 &10 &11 &12 &13 &14 &15 &16 \\
&&&&&&&&&&&&&&&&& \\
\hline
&&&&&&&&&&&&&&&&& \\
$a_n$ &0 &1 &3 &4 &6 &8 &9 &10 &11 &12 &13 &14 &15 &16 &17 &19 &20 \\
&&&&&&&&&&&&&&&&& \\
$b_n$ &0 &2 &5 &7 &18 &33 &42 &44 &66 &68 &94 &96 &136 &138 &172 &175 &177 \\
&&&&&&&&&&&&&&&&& \\
\hline
\end{tabular}
\end{center}
\end{table}}
\end{example}
\vskip 30pt
\section*{\normalsize 6. Computational Complexity Issues}

What is the computational complexity of computing the winning
strategy for our games? Given a position $(x,y)$ with $0\le x\le
y<\infty$, the {\it statement\/} of Theorem~3 enables us to
compute the table of $P$-positions. It suffices to compute it up
to the smallest $n=n_0$ such that $a_{n_0}\ge x$, and thus
determine whether $(x,y)\in{\cal P}$ or in ${\cal N}$. The {\it
proof\/} of Theorem~3 then enables us, if $(x,y)\in{\cal N}$, to
make a winning move to a position in ${\cal P}$. The latter part
of the strategy, that of making a winning move, is clearly
polynomial. The first part, determining whether or not
$(x,y)\in{\cal P}$ is linear in $x$, since $a_{n_0}\le 2x$ by
(15).

Our games, however, are {\it succinct\/}, i.e., the input size is
$\Omega(\log x)$ rather than $\Omega(x)$ (assuming that $y$ is
bounded by a polynomial in $x$). Thus their complexity isn't
obvious a priori. Even if the sequence $B$ grows exponentially,
polynomiality of the strategy doesn't necessarily follow. For
example, I don't know whether the sequence $B$ of ${\mathbf G_3}$
can be computed polynomially.

Special sequences are known to be computable polynomially. For
example, consider the numeration system with bases defined by
the recurrence $u_n=(s+t-1)u_{n-1}+su_{n-2}\ (n\ge 1)$, where
$s, t\in\IZ_{>0}$, with initial conditions $u_{-1}=1/s$, $u_0=1$.
It follows from \cite{Fra1985} that every positive integer $N$
has a unique representation of the form $N=\sum_{i\ge 0} d_iu_i$,
with digits $d_i\in\{0,\dots,s+t-1\}$, such that
$d_{i+1}=s+t-1\Longrightarrow d_i<s$ for all $i\in\IZ_{\ge 0}$.
The representation of the first few entries for the special case
$s=2$, $t=2$, is depicted in Table~10.
\begin{table}
\begin{center}
\setlength{\tabcolsep}{4.35pt}
\centerline{\small Table 11. Representation of the first few integers
in a special numeration system.}
\bigskip
\begin{tabular}{|cccc|c||ccc|c|}
\hline
50 &14 &4 &1 &$n$ &14 &4 &1 &$n$ \\
\hline
&2 &0 &3 &31 &&&1 &1\\
&2 &1 &0 &32 &&&2 &2\\
&2 &1 &1 &33 &&&3 &3\\
&2 &1 &2 &34 &&1 &0 &4\\
&2 &1 &3 &35 &&1 &1 &5\\
&2 &2 &0 &36 &&1 &2 &6\\
&2 &2 &1 &37 &&1 &3 &7\\
&2 &2 &2 &38 &&2 &0 &8\\
&2 &2 &3 &39 &&2 &1 &9\\
&2 &3 &0 &40 &&2 &2 &10\\
&2 &3 &1 &41 &&2 &3 &11\\
&3 &0 &0 &42 &&3 &0 &12\\
&3 &0 &1 &43 &&3 &1 &13\\
&3 &0 &2 &44 &1 &0 &0 &14\\
&3 &0 &3 &45 &1 &0 &1 &15\\
&3 &1 &0 &46 &1 &0 &2 &16\\
&3 &1 &1 &47 &1 &0 &3 &17\\
&3 &1 &2 &48 &1 &1 &0 &18\\
&3 &1 &3 &49 &1 &1 &1 &19\\
1 &0 &0 &0 &50 &1 &1 &2 &20\\
1 &0 &0 &1 &51 &1 &1 &3 &21\\
1 &0 &0 &2 &52 &1 &2 &0 &22\\
1 &0 &0 &3 &53 &1 &2 &1 &23\\
1 &0 &1 &0 &54 &1 &2 &2 &24\\
1 &0 &1 &1 &55 &1 &2 &3 &25\\
1 &0 &1 &2 &56 &1 &3 &0 &26\\
1 &0 &1 &3 &57 &1 &3 &1 &27\\
1 &0 &2 &0 &58 &2 &0 &0 &28\\
1 &0 &2 &1 &59 &2 &0 &1 &29\\
1 &0 &2 &2 &60 &2 &0 &2 &30\\
\hline
\end{tabular}
\end{center}
\end{table}

If we compare Table~11 with Table~8, we might note the following two
properties:

\begin{itemize}
\item All the $a_n$ have representations ending in an {\sl even\/}
number of $0$s, and all the $b_n$ have representations ending in
an {\sl odd\/} number of $0$s.

\item For every $(a_n,b_n)\in{\cal P}$, the representation of
$b_n$ is the ``left shift'' of the representation of $a_n$.
\end{itemize}

Thus $(1,4)$ of Table~8 has representation $(1,10)$, and $(6,22)$
has representation $(12,120)$: $10$ is the ``left shift'' of $1$,
$120$ the left shift of $12$.

These properties hold, in fact, in general for Example~2, which is
a member of another family of sequences and games analyzed
in \cite{Fra1998}. They enable one to win in polynomial time for that
family.

However, we don't even know whether there are NP-hard sequences.
A case in point is the infinite family of octal games \cite{GuSm1956},
\cite{BCG1982} ch.\ 4, even for the subfamily where there are only
finitely many nonzero octal digits. Some octal games have been shown
to have polynomial strategies, (see e.g., \cite{GaPl1989}), but the
complexity of most is unknown.

We mention very briefly other relevant complexities. They include
Kolmogorov complexity, subword
complexity, palindrome complexity, and, we might add, squares complexity.
The {\it subword complexity\/} $c(n)$ of a sequence $S$ is the number
of distinct words of length $n$ occurring in $S$. In \cite{ABCD2003},
this notion is attributed to \cite{ELR1975}. Surveys can be found in
\cite{All1994}, \cite{Fer1999}, \cite{FeKa1999}. The {\it palindrome
complexity\/} $p(n)$ of $S$ is the number of distinct palindromes of
length $n$ in $S$. See e.g., \cite{DaZa2000}, \cite{ABCD2003}. Define
the {\it squares complexity\/} $s(n)$ of $S$ as the number of
distinct squares of length $n$ in $S$. Thus the result of \cite{FrSi1995}
implies that there are binary sequences for which $s(2)=2$, $s(4)=1$,
$s(2k)=0$ for all $k>2$. There is also the notion of {\it program
complexity\/} \cite{Dal1973}, \cite{Dal1974}, \cite{Dal1975}
concerning the complexity of computing a sequence, which is related
to Kolmogorov complexity \cite{Kol1968}.

\vskip 30pt
\section*{\normalsize 7. Epilogue}

We have defined an infinite class of 2-pile subtraction games with
two types of moves: (aaa) remove any positive number from a single
pile; (bbb) remove $k>0$ from one pile, $\ell>0$ from the other.
This move is restricted by the requirement $|k-\ell|<f$, where $f$
is a positive real-valued function. We have shown that a pair $A$,
$B$ of judiciously chosen complementary sequences constitutes the
set of $P$-positions if and only if $f$ is monotone and
semi-additive.


As we have pointed out, the generalized Wythoff game
\cite{Fra1982} is a member of the family of games considered here.
It has the property that a polynomial strategy can be given by
using a special numeration system, and noting that the elements of
$A$ are characterized by ending in an even number of $0$s in that
representation, and those of $B$ are their left shifts. A similar
situation exists for ${\mathbf G_2}$, but with the standard binary
representation as numeration system. With the game in Example~2,
an essentially different numeration system (see \cite{Fra1998})
can be associated to the same effect.

\noindent
{\bf Further studies}

1. With which games can we associate an appropriate numeration
system so as to establish a polynomial strategy?

2. Extend the games in a natural way to handle more than two
piles. This seems to be difficult for Wythoff's game, for which I
have a conjecture; see \cite{Fra1996} \S6(2), \cite{GuNo2002}
Problem~53, \cite{Fra2004} \S5, \cite{SuZe2004}.

3. Compute the Sprague-Grundy function $g$ for the games, which
will enable to play {\it sums\/} of games. For Wythoff's game
this is an as yet unsolved problem, though eventual additive
periodicity has been proved \cite{DFP1999}, \cite{Lan2002}.

4. Compute a strategy for the games when played in mis\`{e}re
version, i.e., the player making the last move loses. This is
easy for Wythoff's game. See \cite{BCG1982}, ch.~13.

5. We have already mentioned the question of the polynomiality of
the strategy. Is there a 2-pile subtraction game that's Pspace-complete?

6. Computation of complexities of $P$-positions sequences, such as
Kol\-mo\-go\-rov-, program-, subword-, palindrome-,
squares-complexities. For the sequence $A$ of Example~2, the
subword complexity was computed in \cite{FSS2001}.

7. Make an about-face: begin with pairs of known complementary
sequences, and design matching 2-pile subtraction
games.\footnote{A first version of this paper appeared in A.S.\
Fraenkel, New games related to old and new sequences, {\it
Advances in Computer Games\/}, Proc.\ 10-th Advances in Computer
Games Conference (ACG-10), Nov.\ 2003, Graz, Austria (H.J\ van den
Herik, H.\ Iida, E.A.\ Heinz, eds.), pp.\ 367--382, Kluwer, 2004.}
\vskip 30pt
 \footnotesize
\begin{thebibliography}{YaYa1997}

\bibitem{All1994}
J-P.\ Allouche, Sur la complexit\`{e} des suites infinies, {\it Bull.\
Belg.\ Math.\ Soc.\/} {\bf 1} (1994) 133--143.

\bibitem{ABCD2003}
J-P.\ Allouche, M.\ Baake, J.\ Cassaigne, D.\ Damanik, Palindrome
complexity, {Theoret.\ Comput.\ Sci.\/} {\bf 292} (2003) 9--31.

\bibitem{AlSh1999}
J-P.\ Allouche and J.\ Shallit, The ubiquitous Prouhet-Thue-Morse
sequence, in: Sequences and their applications (Singapore, 1998), 1--16,
Springer Ser.\ Discrete Math.\ Theor.\ Comput.\ Sci., Springer, London, 1999.

\bibitem{BCG1982}
E.R.\ Berlekamp, J.H.\ Conway and R.K.\ Guy, {\it Winning Ways for your
Mathematical Plays\/}, Vol.\ I \& II, Academic Press, London, 1982.

\bibitem{BlFr1990}
U.\ Blass and A.S.\ Fraenkel [1990], The Sprague--Grundy function for
Wythoff's game, {\it Theoret.\ Comput.\ Sci.\/} (Math Games) {\bf 75}
(1990) 311--333.

\bibitem{CSH1972}
L.\ Carlitz, R.\ Scoville and V.E.\ Hoggatt Jr., Representations for
a special sequence, {\it Fibonacci Quart.\/} {\bf 10} (1972) 499--518; 550.

\bibitem{Con1959}
I.G.\ Connell, A generalization of Wythoff's game, {\it Canad.\ Math.\
Bull.\/} {\bf 2} (1959) 181--190.

\bibitem{Cox1953}
H.S.M.\ Coxeter, The golden section, phyllotaxis and Wythoff's game,
{\it Scripta Math.\/} {\bf 19} (1953) 135--143.

\bibitem{Dal1973}
R.\ P.\ Daley, Minimal-program complexity of sequences with restricted
resources, {\it Information and Control\/} {\bf 23} (1973) 301--312.

\bibitem{Dal1974}
R.\ P.\ Daley, The extent and density of sequences within the
minimal-program complexity hierarchies, {\it J.\ Comput.\ System Sci.\/}
{\bf 9} (1974) 151--163.

\bibitem{Dal1975}
R.\ P.\ Daley, Minimal-program complexity of pseudo-recursive and
pseudo-random sequences, {\it Math.\ Systems Theory\/} {\bf 9} (1975) 83--94.

\bibitem{DaZa2000}
D.\ Damanik and D.\ Zare, Palindrome complexity bounds for primitive
substitution sequences, {\it Discrete Math.\/} 222 (2000) 259--267.

\bibitem{DFP1999}
A.\ Dress, A.\ Flammenkamp and N.\ Pink, Additive periodicity of the
Sprague-Grundy function of certain Nim games, {\it Adv.\ in Appl.\ Math.\/}
{\bf 22} (1999) 249--270.

\bibitem{ELR1975}
A.\ Ehrenfeucht. K.\ P.\ Lee, G.\ Rozenberg, Subword complexities
of various classes of deterministic developmental languages without
interaction, {Theoret.\ Comput.\ Sci.\/} {\bf 1} (1975) 59--75.

\bibitem{Fer1999}
S.\ Ferenczi, Complexity of sequences and dynamical systems,
{\it Discrete Math.\/} {\bf 206} (1999) 145--154.

\bibitem{FeKa1999}
S.\ Ferenczi, Z.\ K\'{a}sa, Complexity for finite finite factors of
infinite sequences, {Theoret.\ Comput.\ Sci.\/} {\bf 218} (1999) 177--195.

\bibitem{Fra1982}
A.S.\ Fraenkel, How to beat your Wythoff games' opponent on three
fronts, {\it Amer.\ Math.\ Monthly\/} {\bf 89} (1982) 353--361.

\bibitem{Fra1984}
A.S.\ Fraenkel, Wythoff games, continued fractions, cedar trees and
Fibonacci searches, {\it Theoret.\ Comput.\ Sci.\/} {\bf 29} (1984) 49--73.

\bibitem{Fra1985}
A.S.\ Fraenkel, Systems of numeration, {\it Amer.\ Math.\ Monthly}
{\bf 92} (1985) 105--114.

\bibitem{Fra1996}
A.S.\ Fraenkel, Scenic trails ascending from sea-level Nim to
alpine chess, in: {\it Games of No Chance\/}, Proc. MSRI Workshop
on Combinatorial Games, July, 1994, Berkeley, CA (R.\ J.\
Nowakowski, ed.), MSRI Publ.\ Vol.~29, Cambridge University Press,
Cambridge, pp. 13--42, 1996.

\bibitem{Fra1998}
A.S.\ Fraenkel, Heap games, numeration systems and sequences,
{\it Annals of Combinatorics\/} {\bf 2} (1998) 197--210.

\bibitem{Fra2004}
A.S.\ Fraenkel, Complexity, appeal and challenges of combinatorial
games, Proc.\ of Dagstuhl Seminar ``Algorithmic Combinatorial Game
Theory'', {\it Theoret.\ Comp.\ Sci\/} {\bf 313} (2004) 393--415,
special issue on Algorithmic Combinatorial Game Theory.

\bibitem{FrBo1973}
A.S.\ Fraenkel and I.\ Borosh, A generalization of Wythoff's game,
{\it J.\ Combin.\ Theory\/} (Ser.~A) {\bf 15} (1973) 175--191.

\bibitem{FrOz1998}
A.S.\ Fraenkel and M.\ Ozery, Adjoining to Wythoff's game its $P$-positions
as moves, {\it Theoret.\ Comput.\ Sci.\/} {\bf 205} (1998) 283--296.

\bibitem{FSS2001}
A.S.\ Fraenkel, T.\ Seeman and J.\ Simpson, The subword complexity
of a two-parameter family of sequences, {\it Electronic J.\ Combinatorics\/}
{\bf 8(2)} (2001) R10, 19pp.\hfill\break
http://www.combinatorics.org/

\bibitem{FrSi1995}
A.S.\ Fraenkel and R.J.\ Simpson, How many squares must a binary
sequence contain? {\it Electronic J.\ Combinatorics\/} {\bf 2}
(1995) R2, 9pp.\hfill\break
http://www.combinatorics.org/

\bibitem{GaPl1989}
A.\ Gangolli and T.\ Plambeck, A note on periodicity in some octal games,
{\it Internat.\ J.\ Game Theory\/} {\bf 18} (1989) 311--320.

\bibitem{GuNo2002}
R.K.\ Guy and R.J.\ Nowakowski, Unsolved problems in combinatorial
games, in: {\it More Games of No Chance\/}, Proc.\ MSRI Workshop on
Combinatorial Games, July, 2000, Berkeley, CA, MSRI Publ. (R.J.\
Nowakowski, ed.), Vol.~42, Cambridge University Press, Cambridge, pp.\
457--473, 2002.

\bibitem{GuSm1956}
R.K.\ Guy and C.A.B.\ Smith [1956], The $G$-values of various games,
{\it Proc.\ Camb.\ Phil.\ Soc.\/} {\bf 52} (1956) 514--526.

\bibitem{Hof1979}
D.R.\ Hofstadter, {\it G\"{o}del, Escher, Bach: An Eternal Golden Braid\/},
Basic Books, New York, 1979.

\bibitem{Kol1968}
A.\ N.\ Kolmogorov, Three approaches to the quantitative definition
of information, {\it Internat.\ J.\ Comput.\ Math.\/} {\bf 2} (1968) 157--168.
(An English translation of the original Russian article in Problemy
Pereda\v{c}i Informacii 1 (1965),vyp. 1, 3--11.)

\bibitem{Lan2002}
H.\ Landman, A simple FSM-based proof of the additive periodicity of the
Sprague-Grundy function of Wythoff's game, in: {\it More Games of No Chance\/},
Proc.\ MSRI Workshop on Combinatorial Games, July, 2000, Berkeley, CA,
MSRI Publ.\ (R.~J. Nowakowski, ed.), Vol.~42, Cambridge University Press,
Cambridge, pp.\ 383--386, 2002.

\bibitem{Sil1976}
R.~Silber, A Fibonacci property of Wythoff pairs, {\it Fibonacci
Quart.\/} {\bf 14} (1976) 380--384.

\bibitem{Sil1977}
R.\ Silber, Wythoff's Nim and Fibonacci representations, {\it Fibonacci
Quart.\/} {\bf 15} (1977) 85--88.

\bibitem{Slo1999}
N.J.A.\ Sloane, My favorite integer sequences, Sequences and their
applications (Singapore, 1998), Springer Ser.\ Discrete Math.\
Theor.\ Comput.\ Sci., Springer, London, pp.\ 103--130, 1999.

\bibitem{SuZe2004}
X.\ Sun and D.\ Zeilberger, On Fraenkel's $N$-heap Wythoff's
conjectures, {\it Ann.\ Comb.\/} {\bf 8} (2004), 225--238.

\bibitem{Wyt1907}
W.A.\ Wythoff, A modification of the game of Nim, {\it Nieuw Arch.\
Wisk.\/} {\bf 7} (1907) 199--202.

\bibitem{YaYa1967}
A.M.\ Yaglom and I.M.\ Yaglom, {\it Challenging Mathematical Problems
with Elementary Solutions\/}, Vol.~II, Holden-Day, San Francisco, translated
by J.\ McCawley, Jr., revised and edited by B.\ Gordon, 1967.

\end{thebibliography}
\end{document}
