betaFeedback

WorksMathematics

An Asymptotic for E. P. Stein Numbers

Abstract

Epstein's put-or-take-a-square game is an impartial combinatorial game in which a player may, in each turn, add or subtract the largest square not exceeding the current integer. We study E. P. Stein numbers, the positions from which both legal moves lead directly to positive squares, and prove the following asymptotic formula for the counting function S2(X)S_2(X) of these positions: S2(X)=1π2X1/4log⁡X+O(X1/4). S_2(X)=\frac{1}{π^2}X^{1/4}\log X+O(X^{1/4}).

Introduction and Motivation

Nim is a mathematical game of strategy in which two players take turns removing objects from distinct heaps or piles; the player who removes the last object wins. Game theorist Richard A. Epstein proposed a variant of Nim known as the put-or-take-a-square game [1], which we study in this paper.

The game starts with a positive integer. Each turn, writing nn for the number the player to move is faced with, that player has two moves:

  1. Subtract ⌊n⌋2\lfloor\sqrt{n}\rfloor^2 from nn; that is, subtract off m2m^2, where mm is the largest integer with m2≤n<(m+1)2m^2 \le n < (m+1)^2. We write D(n)D(n) for this move.

  1. Add ⌊n⌋2\lfloor\sqrt{n}\rfloor^2 to nn. We write U(n)U(n) for this move.

Formally, the two functions, for “down” and “up” respectively, are

D(n)=n−⌊n⌋2,D(n) = n-\lfloor\sqrt{n}\rfloor^2,
U(n)=n+⌊n⌋2.U(n) = n+\lfloor\sqrt{n}\rfloor^2.

So from the position nn, the set of positions reachable in one move is Opt⁡(n)={D(n),U(n)}\operatorname{Opt}(n)=\{D(n),U(n)\}. The game ends when a player moves to 0, and that player wins.

Example 1.1. We illustrate by playing a put-or-take-a-square game starting with n=10n=10.

  1. Player 1 starts with n=10n=10. Since D(10)=1D(10)=1 and U(10)=19U(10)=19, the moves are Opt⁡(10)={1,19}\operatorname{Opt}(10)=\{1,19\}; say Player 1 chooses U(10)=19U(10)=19.

  2. Player 2 now has n=19n=19, whose moves are Opt⁡(19)={3,35}\operatorname{Opt}(19)=\{3,35\}; say Player 2 chooses D(19)=3D(19)=3.

  3. Player 1 now has n=3n=3, whose moves are Opt⁡(3)={2,4}\operatorname{Opt}(3)=\{2,4\}; say Player 1 chooses U(3)=4U(3)=4.

  4. Player 2 now has n=4n=4, whose moves are Opt⁡(4)={0,8}\operatorname{Opt}(4)=\{0,8\}. Player 2 chooses D(4)=0D(4)=0 and wins the game.

Definition 1.2. A remoteness function is a function R(n)R(n) that gives the number of moves until the game ends, given optimal play from position nn.

Note that for our game, R(n)=0R(n)=0 if and only if n=0n=0, and that R(n)=1R(n)=1 if and only if nn is a positive perfect square. Some numbers, such as 2 and 3, have infinite remoteness, because two perfectly rational players would just alternate between 2 and 3 forever.

Sample play of the game starting at $n=10$: $D(10)=10-\lfloor\sqrt{10}\rfloor^2=1$, $U(10)=10+\lfloor\sqrt{10}\rfloor^2=19$, $D(19)=3$, $U(19)=35$, $D(3)=2$, $U(3)=4$, $D(4)=0$, $U(4)=8$; chosen sequence $10\to19\to3\to4\to0$; Player 2 wins

Figure 1. A sample play of the game starting at n=10n=10. The highlighted path shows the sequence 10→19→3→4→010\to19\to3\to4\to0, in which Player 2 wins.

I specified the game and desired illustration, and Astra generated a visual design and TikZ implementation. I manually adjusted the positioning and styling of nodes and edges to improve clarity and decreased the size of the illustration. Produced in 2026.

Definition 1.3. An E. P. Stein number1 is a number nn such that R(n)=2R(n)=2. In other words, an E. P. Stein number is a number such that no matter which move the current player takes from that number, the next turn is guaranteed to have an available move to 00—i.e., a number for which there exist positive integers aa and bb such that D(n)=a2D(n)=a^2 and U(n)=b2U(n)=b^2.

Example 1.4. The number 55 is an E. P. Stein number, since D(5)=12D(5)=1^2 and U(5)=32U(5)=3^2. Although 2929 is a losing position given optimal play for the current player, it is not an E. P. Stein number, since U(29)=29+⌊29⌋2=54U(29)=29+\lfloor\sqrt{29}\rfloor^2=54; and indeed, R(29)=4R(29)=4.

The first few E. P. Stein numbers are 5,20,45,80,1455,20,45,80,145 [3].

Definition 1.5. The E. P. Stein counting function S2(X)S_2(X) is defined as the number of E. P. Stein numbers less than or equal to XX:

S2(X)=#{n≤X:R(n)=2}.S_2(X)=\#\{n\le X:R(n)=2\}.

The purpose of this paper is to prove the following asymptotic:

Theorem 1.6. As X→∞X\to\infty, we have

S2(X)=1π2X1/4log⁡X+O(X1/4).S_2(X)=\frac{1}{\pi^2}X^{1/4}\log X+O(X^{1/4}).

Equivalently, S2(X)∼1π2X1/4log⁡XS_2(X)\sim\frac{1}{\pi^2}X^{1/4}\log X; that is,

lim⁡X→∞S2(X)X1/4log⁡X=1π2,\lim_{X\to\infty}\frac{S_2(X)}{X^{1/4}\log X}=\frac{1}{\pi^2},

with relative error O((log⁡X)−1)O((\log X)^{-1}).

Steuding and Volkert [2] prove that there are infinitely many E. P. Stein numbers, and develop a parameterization for them along the way. For our proof of Theorem 1.6, we build on their method to develop an alternate parameterization that bijectively characterizes the E. P. Stein numbers, using triples (d,u,v)(d,u,v).

After parameterizing E. P. Stein numbers in this way, we count the number of such triples satisfying the necessary inequalities using lattice geometry and equidistribution techniques. Finally, to obtain the asymptotic for S2(X)S_2(X), we will sum over all possible values of dd using Möbius inversion and a weighted harmonic sum.2

A Bijective Parameterization of E. P. Stein Numbers

We first focus on the parameterization of E. P. Stein numbers, which assumes the form n=d2(u4+4v4)n=d^2(u^4+4v^4) with certain divisibility conditions on dd, uu, and vv.

Let m=⌊n⌋m=\lfloor\sqrt{n}\rfloor. For an E. P. Stein number, n−m2=a2n-m^2=a^2 and n+m2=b2n+m^2=b^2. Consequently, we have

b2−a2=2m2,n2=m4+(ab)2.b^2-a^2=2m^2,\qquad n^2=m^4+(ab)^2.

Steuding and Volkert [2] proved the not-necessarily-bijective parameterization

n=g2(U4+4V4),m=2gUV,n = g^2(U^4 + 4V^4), \qquad m = 2gUV,

where UU is odd and gcd⁡(U,V)=1\gcd(U,V) = 1.

Definition 2.1. We define μ∗(n)\mu^*(n) to be 1 if p2∤np^2 \nmid n for all odd primes pp, and 0 otherwise. In other words, the odd part of nn is square-free; the even part may have arbitrary powers of 2.

We now convert the Steuding–Volkert parameterization into a unique form with a μ∗\mu^* condition rather than a coprimality condition.

Theorem 2.2 (Parameterization of E. P. Stein numbers). Define

A={(d,u,v)∈Z>03:u odd, μ∗(d)=1, d(u2−2v2)2≤4uv}.\mathcal{A} = \left\{(d,u,v) \in\mathbb{Z}_{>0}^3 : u\ \text{odd},\ \mu^*(d) = 1,\ d(u^2 - 2v^2)^2 \le4uv\right\}.

Then the map

(d,u,v)↦d2(u4+4v4)(d,u,v) \mapsto d^2(u^4 + 4v^4)

is a bijection from A\mathcal{A} to the set of E. P. Stein numbers.

Proof. We prove that the displayed map indeed sends every triple in A\mathcal{A} to an E. P. Stein number, and that it is surjective and injective.

To prove that the map is well defined, take (d,u,v)∈A(d,u,v) \in\mathcal{A} and set n=d2(u4+4v4)n = d^2(u^4 + 4v^4) and m=2duvm = 2duv. We then have

n−m2=d2(u4+4v4)−4d2u2v2=d2(u2−2v2)2=a2,n - m^2 = d^2(u^4 + 4v^4) - 4d^2u^2v^2 = d^2(u^2 - 2v^2)^2 = a^2,
n+m2=d2(u4+4v4)+4d2u2v2=d2(u2+2v2)2=b2.n + m^2 = d^2(u^4 + 4v^4) + 4d^2u^2v^2 = d^2(u^2 + 2v^2)^2 = b^2.

It now suffices to show that m2<n<(m+1)2m^2 < n < (m + 1)^2. Since m=2duvm = 2duv, we have 4d2u2v2<d2(u4+4v4)4d^2u^2v^2 < d^2(u^4 + 4v^4) from 0<d2(u2−2v2)20 < d^2(u^2 - 2v^2)^2. Note that u2−2v2u^2 - 2v^2 cannot be zero because uu is odd. Moreover, because d(u2−2v2)2≤4uvd(u^2 - 2v^2)^2 \le4uv, it follows that n−m2≤2mn - m^2 \le2m, and so n<(m+1)2n < (m + 1)^2. Hence ⌊n⌋=m\lfloor\sqrt{n}\rfloor= m, so that D(n)=a2D(n) = a^2 and U(n)=b2U(n) = b^2 are both positive squares and nn is an E. P. Stein number.

For surjectivity, let nn be an E. P. Stein number. The argument of Steuding and Volkert [2 p.3] yields positive integers gg, UU, VV, with UU odd and gcd⁡(U,V)=1\gcd(U,V) = 1, such that

n=g2(U4+4V4)n = g^2(U^4 + 4V^4)

with g(U2−2V2)2≤4UVg(U^2-2V^2)^2 \le4UV. Uniquely factor g=dk2g=dk^2, where kk is odd and μ∗(d)=1\mu^*(d)=1: all powers of 2 remain in dd, while for each odd prime pp, pairs of powers of pp go into k2k^2, leaving exponent 0 or 1 in dd. Now set u=kUu=kU and v=kVv=kV. We then have

n=d2(k4U4+4k4V4)=d2(u4+4v4)n=d^2(k^4U^4+4k^4V^4)=d^2(u^4+4v^4)

and

dk4(U2−2V2)2≤4k2UV,dk^4(U^2-2V^2)^2\le4k^2UV,
d(u2−2v2)2≤4uv.d(u^2-2v^2)^2\le4uv.

Because kk and UU are odd, uu is too; and μ∗(d)=1\mu^*(d)=1 by the construction g=dk2g=dk^2. Thus (d,u,v)∈A(d,u,v)\in\mathcal{A}, as desired; in other words, every E. P. Stein number is in the image of the stated map.

To prove injectivity, suppose (d1,u1,v1),(d2,u2,v2)∈A(d_1,u_1,v_1),(d_2,u_2,v_2)\in\mathcal{A} and d12(u14+4v14)=d22(u24+4v24)=nd_1^2(u_1^4+4v_1^4)=d_2^2(u_2^4+4v_2^4)=n. Let ki=gcd⁡(ui,vi)k_i=\gcd(u_i,v_i) for i=1,2i=1,2. Then n=(diki2)2(Ui4+4Vi4)=gi2(Ui4+4Vi4)n=(d_ik_i^2)^2(U_i^4+4V_i^4)=g_i^2(U_i^4+4V_i^4), where gi=diki2g_i=d_ik_i^2, Ui=uikiU_i=\frac{u_i}{k_i}, and Vi=vikiV_i=\frac{v_i}{k_i}; moreover, gcd⁡(Ui,Vi)=1\gcd(U_i,V_i)=1, and kik_i is odd because it divides the odd number uiu_i.

From the parameterization argument above, ⌊n⌋=mi=2giUiVi\lfloor\sqrt{n}\rfloor=m_i=2g_iU_iV_i, so m:=m1=m2m:=m_1=m_2. Let a=n−m2=gi∣Ui2−2Vi2∣a=\sqrt{n-m^2}=g_i\lvert U_i^2-2V_i^2\rvert and b=n+m2=gi(Ui2+2Vi2)b=\sqrt{n+m^2}=g_i(U_i^2+2V_i^2).

We now claim that g:=g1=g2g:=g_1=g_2. This is because

gcd⁡(Ui2−2Vi2,Ui2+2Vi2,2UiVi)=1,\gcd(U_i^2-2V_i^2,U_i^2+2V_i^2,2U_iV_i)=1,

which can be seen from the coprimality of UiU_i and ViV_i together with the oddness of UiU_i, and so gcd⁡(a,b,m)=gi=g\gcd(a,b,m)=g_i=g. Next, we observe that

{Ui2,2Vi2}={b+a2g,b−a2g};\left\{U_i^2,2V_i^2\right\}=\left\{\frac{b+a}{2g},\frac{b-a}{2g}\right\};

the right-hand side depends only on nn. Of these two integers on the left-hand side of the correspondence above, Ui2U_i^2 is the odd one and 2Vi22V_i^2 is the even one. Thus U:=U1=U2U:=U_1=U_2 and V:=V1=V2V:=V_1=V_2.

Recall from earlier that ki=gcd⁡(ui,vi)k_i=\gcd(u_i,v_i). For each ii we have g=gi=diki2g=g_i=d_ik_i^2, where kik_i is odd and μ∗(di)=1\mu^*(d_i)=1. This factorization is unique: for every odd prime, all pairs of prime factors go into ki2k_i^2, while the remaining exponent 0 or 1 stays in did_i, and the entire power of 2 stays in did_i. Hence d1=d2d_1=d_2 and k1=k2k_1=k_2; it then follows that u1=k1U=k2U=u2u_1=k_1U=k_2U=u_2 and v1=k1V=k2V=v2v_1=k_1V=k_2V=v_2. Thus

(d1,u1,v1)=(d2,u2,v2),(d_1,u_1,v_1)=(d_2,u_2,v_2),

so the map is injective. Having shown that the map sends A\mathcal{A} into the E. P. Stein numbers and is both injective and surjective, we conclude that it is a bijection, as desired. □

Theorem 2.2 allows us to iterate over positive integer triples (d,u,v)(d,u,v) satisfying the stated inequality with no coprimality conditions on uu and vv (as opposed to Steuding and Volkert’s original parameterization); this lets us sum over the relevant triples more directly.

Example 2.3. Take d=1d=1, u=3u=3, v=2v=2. Then

n=34+4⋅24=81+64=145,n=3^4+4\cdot2^4=81+64=145,
m=2⋅3⋅2=12.m=2\cdot3\cdot2=12.

Since D(145)=145−122=1D(145)=145-12^2=1 and U(145)=145+122=289U(145)=145+12^2=289, the triple (1,3,2)(1,3,2) produces an E. P. Stein number, 145, as desired. In our game, both of 145’s legal moves reach positive squares, and the player’s opponent can reach 0 on the next turn regardless of which move is chosen.

Definition 2.4. Define Td(Y)T_d(Y) as the number of positive integer pairs (u,v)(u,v), with uu odd, satisfying

d(u2−2v2)2≤4uvd(u^2-2v^2)^2\le4uv

and

d2(u4+4v4)≤Y4.d^2(u^4+4v^4)\le Y^4.

Throughout, YY denotes the fourth root of the cutoff, so that counting E. P. Stein numbers up to XX means taking Y=X1/4Y=X^{1/4}; the condition d2(u4+4v4)≤Y4d^2(u^4+4v^4)\le Y^4 is then exactly the requirement that the E. P. Stein number constructed from (d,u,v)(d,u,v) be at most XX. We can thus think of Td(Y)T_d(Y) as counting, for fixed dd, the triples (d,u,v)(d,u,v) that satisfy every condition defining A\mathcal{A} except μ∗(d)=1\mu^{*}(d)=1, subject to the additional constraint that the associated E. P. Stein number is at most XX.

As a consequence of Theorem 2.2, our desired count is thus

S2(Y4)=∑d≥1μ∗(d)Td(Y).S_2(Y^4)=\sum_{d\ge1}\mu^{*}(d)T_d(Y).

The factor μ∗(d)\mu^{*}(d) appears because we have omitted the μ∗(d)\mu^{*}(d) condition in the definition of Td(Y)T_d(Y). Note, however, that dd satisfies

d≤4uv≤2u4+4v4≤2Y2d,d\le4uv\le2\sqrt{u^4+4v^4}\le\frac{2Y^2}{d},

and thus d≤2Yd\le\sqrt{2Y}; otherwise Td(Y)=0T_d(Y)=0. This allows us to evaluate the sum

S2(Y4)=∑1≤d≤2Yμ∗(d)Td(Y).S_2(Y^4)=\sum_{1\le d\le\sqrt{2Y}}\mu^{*}(d)T_d(Y).

Lattice Geometry and Equidistribution

We have now converted the problem of counting E. P. Stein numbers into a number-theoretic problem of counting integer points in a region defined by certain inequalities. Moving forward, we will estimate the distribution of the lattice points in this valid region by utilizing a change of variables and approximating each lattice point count with the corresponding area of the region it occupies.

Our eventual counting problem will reduce to determining how often the fractional parts of v/2v/\sqrt{2} lie in a short interval; the following lemma provides a rough estimate for this count.

Lemma 3.1. Let α=12\alpha= \frac{1}{\sqrt{2}}, and let pq\frac{p}{q} be a rational number with p,q>0p,q > 0, gcd⁡(p,q)=1\gcd(p,q) = 1, and

∣α−pq∣<1q2.\left|\alpha-\frac{p}{q}\right|<\frac{1}{q^2}.

Then, uniformly over real phases θ\theta, over intervals I⊆[0,1)I \subseteq[0,1) of length w∈[0,1)w \in[0,1) taken modulo 11, and over integers V≥1V \ge1, we have

n(V)=#{1≤v≤V:⟨αv+θ⟩∈I}=Vw+O(Vq+qw+1).n(V)=\#\{1\leq v\leq V:\langle\alpha v+\theta\rangle\in I\}=Vw+O\left(\frac{V}{q}+qw+1\right).

where ⟨x⟩\langle x\rangle denotes the fractional part of xx, so that ⟨αv+θ⟩\langle\alpha v+\theta\rangle is αv+θ\alpha v+\theta (mod 11).

Figure 2. Schematic illustration of the orbit points ⟨θ+kα⟩\langle\theta+k\alpha\rangle on the unit interval—illustrated as a circle here for visualizing the modular arithmetic—and the highlighted interval II of length ww, where n(V)n(V) counts the number of points falling into II. The plotted positions of the orbit points are schematic and spaced for legibility and are not the actual positions of ⟨θ+kα⟩\langle\theta+k\alpha\rangle for any particular θ\theta and α\alpha.

The initial diagram was generated with Astra; Astra subsequently supplied TikZ code and revisions based on my visual feedback, and then I manually edited the positioning and size of various nodes to improve readability and spacing. Produced in 2026.

Proof. We define a block to be qq consecutive terms of the sequence

(⟨θ+vα⟩)v≥1.\left(\langle\theta+v\alpha\rangle\right)_{v\ge1}.

Say that we are analyzing the block ⟨θ+(ℓ+j)α⟩\langle\theta+(\ell+j)\alpha\rangle for 0≤j<q0\le j<q. Comparing this with ⟨θ+ℓα+jpq⟩\left\langle\theta+\ell\alpha+j\frac{p}{q}\right\rangle, continued fraction theory for non-zero jj [4] yields the inequality

j∣α−pq∣≤jq2<1q.j\left|\alpha-\frac{p}{q}\right|\le\frac{j}{q^2}<\frac{1}{q}.

and so each actual point is within 1q\frac{1}{q} of the corresponding rational point. Since gcd⁡(p,q)=1\gcd(p,q)=1, the rational comparison points form a translate modulo 11 of the evenly spaced grid

{0,1q,…,q−1q}.\left\{0,\frac{1}{q},\ldots,\frac{q-1}{q}\right\}.

Hence an interval of length ww contains qw+O(1)qw+O(1) of these comparison points. Moving a comparison point by less than 1/q1/q can change whether it belongs to II only if it lies within distance 1/q1/q of an endpoint of II. Since the grid points are spaced 1/q1/q apart, only O(1)O(1) points can lie in these endpoint neighborhoods. Therefore, each complete block contains qw+O(1)qw+O(1) actual orbit points in II, uniformly in the starting index, phase, and interval.

Now write V=Mq+HV=Mq+H, where 0≤H<q0\le H<q. The first MqMq terms consist of MM complete blocks, each contributing qw+O(1)qw+O(1) points in II. Let RHR_H denote the number of points in II among the remaining HH terms. Since these terms are contained in one additional complete block, we have

0≤RH≤qw+O(1).0\le R_H\le qw+O(1).

Moreover, 0≤Hw≤qw0\le Hw\le qw, so

RH=Hw+O(qw+1).R_H=Hw+O(qw+1).

Combining the complete blocks and the remainder gives

n(V)=M(qw+O(1))+RH=Mqw+Hw+O(M+qw+1)=Vw+O(Vq+qw+1).\begin{aligned} n(V)&=M(qw+O(1))+R_H\\ &=Mqw+Hw+O(M+qw+1)\\ &=Vw+O\left(\frac{V}{q}+qw+1\right). \end{aligned}

as desired. □\square

We now employ a “sandwich” argument and a change of variables—where t=u−2vt=u-\sqrt{2}v—to trap the admissible pairs (t,v)(t,v) between two rectangles: an inner rectangle Rin\mathcal{R}_{\mathrm{in}} and an outer rectangle Rout\mathcal{R}_{\mathrm{out}}. Define

Ωd(Y)={(t,v):v≥1, u=t+2v>0,d(u2−2v2)2≤4uv,d2(u4+4v4)≤Y4}.\Omega_d(Y)=\left\{(t,v): \begin{aligned} &v\ge1,\ u=t+\sqrt{2}v>0,\\ &d(u^2-2v^2)^2\le4uv,\\ &d^2(u^4+4v^4)\le Y^4 \end{aligned} \right\}.

Note that t=u−2vt=u-\sqrt{2}v is in general irrational, so the points of Ωd(Y)\Omega_d(Y) are not themselves lattice points. Rather, Td(Y)T_d(Y) counts the integer pairs (u,v)(u,v), with uu odd, whose transformed coordinates (t,v)(t,v) lie in Ωd(Y)\Omega_d(Y). The difference between the two rectangles is that if (t,v)∈Rin(t,v)\in\mathcal{R}_{\mathrm{in}}, it necessarily follows that (t,v)∈Ωd(Y)(t,v)\in\Omega_d(Y); whereas if (t,v)∈Ωd(Y)(t,v)\in\Omega_d(Y), it only follows that (t,v)∈Rout(t,v)\in\mathcal{R}_{\mathrm{out}}. The next three propositions establish precise bounds for (t,v)(t,v) within these rectangles, and hence bound the Ωd(Y)\Omega_d(Y) region; in other words, they show that Rin⊆Ωd(Y)⊆Rout\mathcal{R}_{\mathrm{in}}\subseteq\Omega_d(Y)\subseteq\mathcal{R}_{\mathrm{out}}.

Figure 3. Schematic illustration of Rin⊆Ωd(Y)⊆Rout\mathcal{R}_{\mathrm{in}}\subseteq\Omega_d(Y)\subseteq\mathcal{R}_{\mathrm{out}}. We use this schematic to visualize bounding the area of Ωd(Y)\Omega_d(Y) between the areas of the inner and outer rectangles. Astra generated the original visual, then recreated it in TikZ after I requested the design. The figure is schematic rather than an exact plot of Ωd(Y)\Omega_d(Y)—I manually adjusted the shape of some of the boundaries and the positioning of the rectangles and arrows for readability. Produced in 2026.

Throughout, we use the conventions c=2−1/4c=2^{-1/4}, c′=2−3/4c'=2^{-3/4}, and Y4=XY^4=X.

The inequality d(u2−2v2)2≤4uvd(u^2-2v^2)^2\le4uv defining Ωd(Y)\Omega_d(Y) is nonlinear in uu and vv, but becomes simpler when expressed in terms of the distance t=u−2vt=u-\sqrt{2}v from the line u=2vu=\sqrt{2}v. The following equivalence allows us to bound the width of Ωd(Y)\Omega_d(Y) in the tt-direction.

Proposition 3.2. Let d≥1d\ge1, u>0u>0, and v≥1v\ge1, and let t=u−2vt=u-\sqrt{2}v and s=u+2vs=u+\sqrt{2}v. Then

d(u2−2v2)2≤4uv⟺t2(d+12s2)≤12.d(u^2-2v^2)^2\le4uv\quad\Longleftrightarrow\quad t^2\left(d+\frac{1}{\sqrt{2}s^2}\right)\le\frac{1}{\sqrt{2}}.

Proof. First, note that ss and tt satisfy s2t2=(u2−2v2)2s^2t^2=(u^2-2v^2)^2 and s2−t22=4uv\frac{s^2-t^2}{\sqrt{2}}=4uv. Using the condition d(u2−2v2)2≤4uvd(u^2-2v^2)^2\le4uv, we find that

ds2t2≤s2−t22ds^2t^2\le\frac{s^2-t^2}{\sqrt{2}}
dt2≤12−t2s22dt^2\le\frac{1}{\sqrt{2}}-\frac{t^2}{s^2\sqrt{2}}
t2(d+12s2)≤12,t^2\left(d+\frac{1}{\sqrt{2}s^2}\right)\le\frac{1}{\sqrt{2}},

as desired. The converse is obtained by reversing these steps. □

To obtain a lower bound for Td(Y)T_d(Y), we first construct a rectangle contained entirely in Ωd(Y)\Omega_d(Y). Counting integer pairs in this rectangle will provide a lower bound for the count in Ωd(Y)\Omega_d(Y).

Proposition 3.3. For d≥1d\ge1 and Y≥2Y\ge2, let

Rin={(t,v):1≤v≤d(Y−c)d, ∣t∣≤cd+122}.\mathcal{R}_{\mathrm{in}}=\left\{(t,v):1\le v\le\frac{d(Y-c)}{\sqrt{d}},\ |t|\le\frac{c}{\sqrt{d+\frac{1}{2\sqrt{2}}}}\right\}.

Then Rin⊆Ωd(Y)\mathcal{R}_{\mathrm{in}}\subseteq\Omega_d(Y).

Proof. Suppose (t,v)∈Rin(t,v)\in\mathcal{R}_{\mathrm{in}}. Apply the L4L^4 norm to the points (u,2v)(u,\sqrt{2}v) and (2v,2v)(\sqrt{2}v,\sqrt{2}v), together with the triangle inequality, to obtain

∥(u,2v)∥4≤∥(u−2v,0)∥4+∥(2v,2v)∥4\left\|(u,\sqrt{2}v)\right\|_4\le\left\|(u-\sqrt{2}v,0)\right\|_4+\left\|(\sqrt{2}v,\sqrt{2}v)\right\|_4
(u4+4v4)1/4≤∣t∣+23/4v,(u^4+4v^4)^{1/4}\le|t|+2^{3/4}v,

where t=u−2vt=u-\sqrt{2}v as before. Since vv satisfies the bound defining Rin\mathcal{R}_{\mathrm{in}},

(u4+4v4)1/4≤∣t∣+23/4v<Y−cd+cd=Yd.(u^4+4v^4)^{1/4}\le|t|+2^{3/4}v<\frac{Y-c}{\sqrt{d}}+\frac{c}{\sqrt{d}}=\frac{Y}{\sqrt{d}}.

Rearranging shows that d2(u4+4v4)≤Y4=Xd^{2}(u^{4}+4v^{4}) \le Y^{4}=X, as desired. Next, since v≥1v \ge1 and ∣t∣≤cd+122<2|t| \le\frac{c}{\sqrt{d+\frac{1}{2\sqrt{2}}}}<\sqrt{2}, we have u=t+2v>0u=t+\sqrt{2}v>0; hence s=u+2v>2v≥2s=u+\sqrt{2}v>\sqrt{2}v\ge\sqrt{2}, so s2≥2s^{2}\ge2 and

t2(d+12s2)≤t2(d+122)≤12,t^{2}\left(d+\frac{1}{\sqrt{2}s^{2}}\right)\le t^{2}\left(d+\frac{1}{2\sqrt{2}}\right)\le\frac{1}{\sqrt{2}},

which by Proposition 3.2 is the required inequality. □

For the corresponding upper bound, we enclose Ωd(Y)\Omega_{d}(Y) in a larger rectangle. Together with Proposition 3.3, this will allow us to estimate Td(Y)T_{d}(Y) by counting points in two simpler regions.

Proposition 3.4. For d≥1d \ge1 and Y≥2Y \ge2, let

Rout={(t,v):1≤v≤c′(Y+c)d, ∣t∣≤cd}.\mathcal{R}_{\mathrm{out}}=\left\{(t,v):1\le v\le\frac{c'(Y+c)}{\sqrt{d}},\ |t|\le\frac{c}{\sqrt{d}}\right\}.

Then Ωd(Y)⊂Rout\Omega_{d}(Y)\subset\mathcal{R}_{\mathrm{out}}.

Proof. Suppose that (t,v)∈Ωd(Y)(t,v)\in\Omega_{d}(Y). By Proposition 3.2, we know that t2(d+12s2)≤12t^{2}\left(d+\frac{1}{\sqrt{2}s^{2}}\right)\le\frac{1}{\sqrt{2}}, and thus t2d≤12t^{2}d\le\frac{1}{\sqrt{2}}. Hence ∣t∣≤124d=cd|t|\le\frac{1}{\sqrt[4]{2}\sqrt{d}}=\frac{c}{\sqrt{d}}, as desired.

From the same L4L^{4} norm argument we used to prove the inequality in Proposition 3.3, we have

23/4v≤∣t∣+(u4+4v4)1/4,2^{3/4}v\le|t|+(u^{4}+4v^{4})^{1/4},

and thus

23/4v≤Yd+cd,2^{3/4}v\le\frac{Y}{\sqrt{d}}+\frac{c}{\sqrt{d}},

so that v≤c′(Y+c)dv\le\frac{c'(Y+c)}{\sqrt{d}}, as desired. □

Now that we have inequalities describing the inner and outer rectangles that sandwich Ωd(Y)\Omega_{d}(Y), we can estimate the number of integer pairs (u,v)(u,v) with odd uu in these regions to bound Td(Y)T_{d}(Y).

Lemma 3.5. The quantity Td(Y)T_{d}(Y) satisfies

Td(Y)=Y2d+O(Yd2+Yd+1).T_{d}(Y)=\frac{Y}{2d}+O\left(\frac{Y}{d^{2}}+\sqrt{\frac{Y}{d}}+1\right).

Proof. Let N±N_{\pm} count the number of integer pairs with odd uu in our rectangles, with N+N_{+} counting those in the outer rectangle Rout\mathcal{R}_{\mathrm{out}} and N−N_{-} counting those in the inner rectangle Rin\mathcal{R}_{\mathrm{in}}. Notice that counting the odd uu satisfying ∣u−2v∣≤h<1|u-\sqrt{2}v|\le h<1 is equivalent to counting the solutions of

∣2k+1−2v∣≤h|2k+1-\sqrt{2}v|\le h
∣k+12−12v∣≤h2−h2≤v2−k−12≤h2.\left|k+\frac{1}{2}-\frac{1}{\sqrt{2}}v\right|\le\frac{h}{2} \\ -\frac{h}{2}\le\frac{v}{\sqrt{2}}-k-\frac{1}{2}\le\frac{h}{2}.

Thus the fractional part of v2\frac{v}{\sqrt{2}} must lie in the interval

⟨v2⟩∈[12−h2,12+h2].\left\langle\frac{v}{\sqrt{2}}\right\rangle\in\left[\frac{1}{2}-\frac{h}{2},\frac{1}{2}+\frac{h}{2}\right].

Both the inner and outer rectangles have the form 1≤v≤L1\le v\le L and ∣u−2v∣≤h\lvert u-\sqrt{2}v\rvert\le h, where uu must be odd. Thus we may apply Lemma 3.1 to obtain

N±=⌊L±⌋h±+O(⌊L±⌋q+qh±+1).N_{\pm}=\left\lfloor L_{\pm}\right\rfloor h_{\pm}+O\left(\frac{\left\lfloor L_{\pm}\right\rfloor}{q}+qh_{\pm}+1\right).

Now select a convergent denominator qq such that Y≤q≤6Y\sqrt{Y}\le q\le6\sqrt{Y}, which is possible since the denominators increase by a factor less than 6 by a standard recursion in Pell’s equations [4]; this gives the approximation q≍Yq\asymp\sqrt{Y}. From Propositions 3.3 and 3.4, we know that L±=O(Yd)L_{\pm}=O\left(\frac{Y}{\sqrt{d}}\right) and h±=O(1d)h_{\pm}=O\left(\frac{1}{\sqrt{d}}\right).

We now evaluate the error terms in the expression for N±N_{\pm}. Since q≥Yq\ge\sqrt{Y}, we have ∣L±∣q≤L±q=O(Y/dY)=O(Yd)\frac{\lvert L_{\pm}\rvert}{q}\le\frac{L_{\pm}}{q}=O\left(\frac{Y/\sqrt{d}}{\sqrt{Y}}\right)=O\left(\sqrt{\frac{Y}{d}}\right) and qh±≤6Ycd=O(Yd)qh_{\pm}\le6\sqrt{Y}\frac{c}{\sqrt{d}}=O\left(\sqrt{\frac{Y}{d}}\right). Thus the overall error term simplifies to

N±=L±h±+O(Yd+1).N_{\pm}=L_{\pm}h_{\pm}+O\left(\sqrt{\frac{Y}{d}}+1\right).

We then have

L+h+=c′(Y+c)d⋅cd=cc′(Y+c)d=Y+c2d=Y2d+O(1),L_{+}h_{+}=\frac{c'(Y+c)}{\sqrt{d}}\cdot\frac{c}{\sqrt{d}}=\frac{cc'(Y+c)}{d}=\frac{Y+c}{2d}=\frac{Y}{2d}+O(1),

and similarly

L−h−=c′(Y−c)d⋅cd+122=Y−c2d(d+122)=Y2d+O(Yd2+1).\begin{aligned} L_{-}h_{-}=\frac{c'(Y-c)}{\sqrt{d}}\cdot\frac{c}{\sqrt{d+\frac{1}{2\sqrt{2}}}}=\frac{Y-c}{2\sqrt{d\left(d+\frac{1}{2\sqrt{2}}\right)}} \\ &=\frac{Y}{2d}+O\left(\frac{Y}{d^{2}}+1\right). \end{aligned}

Writing Ed(Y)=Yd2+Yd+1E_d(Y)=\frac{Y}{d^2}+\sqrt{\frac{Y}{d}}+1, the preceding estimates give N±=Y2d+O(Ed(Y))N_{\pm}=\frac{Y}{2d}+O(E_d(Y)). Since Rin⊆Ωd(Y)⊆Rout\mathcal{R}_{\mathrm{in}}\subseteq\Omega_d(Y)\subseteq\mathcal{R}_{\mathrm{out}}, the counts satisfy N−≤Td(Y)≤N+N_-\leq T_d(Y)\leq N_+, and we obtain

Td(Y)=Y2d+O(Yd2+Yd+1).T_d(Y)=\frac{Y}{2d}+O\left(\frac{Y}{d^2}+\sqrt{\frac{Y}{d}}+1\right).

as desired.

Proof of the Asymptotic

Having developed our machinery, we now turn to the proof of Theorem 1.6, which we restate here for convenience: as X→∞X\to\infty, the counting function of the E. P. Stein numbers—that is, of the losing positions of remoteness 2—satisfies

S2(X)=1π2X1/4log⁡X+O(X1/4).S_2(X)=\frac{1}{\pi^2}X^{1/4}\log X+O(X^{1/4}).

so that the relative error is O((log⁡X)−1)O((\log X)^{-1}).

The constant 1π2\frac{1}{\pi^2} is of particular interest: as we will see, it arises from a Dirichlet sum that comes from the parameterization of every E. P. Stein number.

In Lemma 4.1 below it will be convenient to write K=2YK=\sqrt{2Y}.

Lemma 4.1. We have

∑d≤Kμ∗(d)d=8π2log⁡K+O(1).\sum_{d\leq K}\frac{\mu^*(d)}{d}=\frac{8}{\pi^2}\log K+O(1).

The proof rests on the following elementary identity.

Proposition 4.2. The odd square-free indicator function μ∗(d)\mu^*(d) is given by

μ∗(d)=∑k2∣d,k oddμ(k),\mu^*(d)=\sum_{\substack{k^2\mid d,\, k\ \mathrm{odd}}}\mu(k),

where μ\mu is the classical Möbius function.

Proof. The sum is equivalent to

μ∗(d)=∏p2∣d,p odd(1+μ(p)).\mu^*(d)=\prod_{\substack{p^2\mid d,\, p\ \mathrm{odd}}}(1+\mu(p)).

This is exactly the definition of the odd square-free indicator function μ∗(d)\mu^*(d), since if any one of the odd primes squared divides dd then the corresponding term in the product is 0, and otherwise the product is 1.

Proof of Lemma 4.1. We apply Proposition 4.2 to evaluate the sum:

∑d≤Kμ∗(d)d=∑d≤K1d∑k2∣dk oddμ(k)=∑k oddμ(k)∑d≤Kk2∣d1d=∑k≤Kk oddμ(k)k2∑m≤K/k21m=∑k≤Kk oddμ(k)k2(log⁡Kk2+O(1))=log⁡K∑k≤Kk oddμ(k)k2−2∑k≤Kk oddμ(k)log⁡kk2+O(1)=43⋅6π2log⁡K+O(1)=8π2log⁡K+O(1).\begin{aligned} \sum_{d\le K}\frac{\mu^*(d)}{d} &=\sum_{d\le K}\frac{1}{d}\sum_{\substack{k^2\mid d\\ k\ \mathrm{odd}}}\mu(k)\\ &=\sum_{k\ \mathrm{odd}}\mu(k)\sum_{\substack{d\le K\\ k^2\mid d}}\frac{1}{d}\\ &=\sum_{\substack{k\le\sqrt{K}\\ k\ \mathrm{odd}}}\frac{\mu(k)}{k^2}\sum_{m\le K/k^2}\frac{1}{m}\\ &=\sum_{\substack{k\le\sqrt{K}\\ k\ \mathrm{odd}}}\frac{\mu(k)}{k^2}\left(\log\frac{K}{k^2}+O(1)\right)\\ &=\log K\sum_{\substack{k\le\sqrt{K}\\ k\ \mathrm{odd}}}\frac{\mu(k)}{k^2} -2\sum_{\substack{k\le\sqrt{K}\\ k\ \mathrm{odd}}}\frac{\mu(k)\log k}{k^2}+O(1)\\ &=\frac{4}{3}\cdot\frac{6}{\pi^2}\log K+O(1) =\frac{8}{\pi^2}\log K+O(1). \end{aligned}

Lemma 4.3. We have

∑d≤2Y(Yd2+Yd+1)=O(Y).\sum_{d\le\sqrt{2Y}}\left(\frac{Y}{d^2}+\sqrt{\frac{Y}{d}}+1\right)=O(Y).

Proof. We split the sum into three separate sums:

∑d≤2Y(Yd2+Yd+1)=∑d≤2YYd2+∑d≤2YYd+∑d≤2Y1≤Y∑d≤2Y1d2+Y∑d≤2Y1d+∑d≤2Y1≤Y⋅O(1)+Y⋅O(Y)+O(Y)=O(Y)+O(Y)+O(Y)=O(Y).\begin{aligned} \sum_{d\le\sqrt{2Y}}\left(\frac{Y}{d^2}+\sqrt{\frac{Y}{d}}+1\right) &=\sum_{d\le\sqrt{2Y}}\frac{Y}{d^2} +\sum_{d\le\sqrt{2Y}}\sqrt{\frac{Y}{d}} +\sum_{d\le\sqrt{2Y}}1\\ &\le Y\sum_{d\le\sqrt{2Y}}\frac{1}{d^2} +\sqrt{Y}\sum_{d\le\sqrt{2Y}}\frac{1}{\sqrt d} +\sum_{d\le\sqrt{2Y}}1\\ &\le Y\cdot O(1)+\sqrt{Y}\cdot O(\sqrt{Y})+O(Y)\\ &=O(Y)+O(Y)+O(Y)=O(Y). \end{aligned}

We are now in a position to prove the main theorem.

Proof of Theorem 1.6. Substituting K=2YK=\sqrt{2}Y in Lemma 4.1 and combining it with Lemmas 3.5 and 4.3 yields

S2(Y4)=∑d≤2Yμ∗(d)Td(Y)=Y2∑d≤2Yμ∗(d)d+O(∑d≤2Y[Yd2+Yd+1])=Y2(8π2log⁡(2Y)+O(1))+O(Y)=4π2Ylog⁡Y+O(Y)=1π2X1/4log⁡X+O(X1/4),\begin{aligned} S_2(Y^4) &= \sum_{d\leq\sqrt{2}Y}\mu^*(d)T_d(Y)\\ &= \frac{Y}{2}\sum_{d\leq\sqrt{2}Y}\frac{\mu^*(d)}{d}+O\left(\sum_{d\leq\sqrt{2}Y}\left[\frac{Y}{d^2}+\sqrt{\frac{Y}{d}}+1\right]\right)\\ &= \frac{Y}{2}\left(\frac{8}{\pi^2}\log(\sqrt{2}Y)+O(1)\right)+O(Y)\\ &= \frac{4}{\pi^2}Y\log Y+O(Y)\\ &= \frac{1}{\pi^2}X^{1/4}\log X+O(X^{1/4}), \end{aligned}

as desired. Here we used that 0≤μ∗(d)≤10\leq\mu^*(d)\leq1, so the weighted errors are at most the unweighted ones. □

Computational Results

While Theorem 1.6 gives an asymptotic for S2(X)S_2(X), it says nothing about how closely that asymptotic tracks S2(X)S_2(X) at any particular XX. Thus here we perform an exact enumeration of the E. P. Stein numbers up to X=1028X=10^{28}, so that the asymptotic can be checked against exact counts over a wide range. In our proof earlier, we counted normalized triples (d,u,v)(d,u,v) with μ∗(d)=1\mu^*(d)=1 and no coprimality restrictions on uu and vv. For the enumeration below, however, we instead iterate over coprime pairs (U,V)(U,V) with UU odd, where gg denotes the scaling factor in the original Steuding–Volkert parameterization.

For any triple (g,U,V)(g,U,V) and an E. P. Stein number nn, we have

n=g2(U4+4V4)≤Xg(U2−2V2)2≤4UV.\begin{aligned} n&=g^2(U^4+4V^4)\leq X\\ g(U^2-2V^2)^2&\leq4UV. \end{aligned}

Given a coprime pair (U,V)(U,V), then, we can count the number of valid gg to sum over as

GX(U,V)=min⁡{⌊XU4+4V4⌋,⌊4UV(U2−2V2)2⌋}.G_X(U,V)=\min\left\{\left\lfloor\sqrt{\frac{X}{U^4+4V^4}}\right\rfloor,\left\lfloor\frac{4UV}{(U^2-2V^2)^2}\right\rfloor\right\}.

To sum over UU and VV, notice that 4V4≤U4+4V4≤X4V^4\leq U^4+4V^4\leq X, and so it suffices to consider

1≤V≤⌊(X4)1/4⌋.1 \le V \le\left\lfloor\left(\frac{X}{4}\right)^{1/4} \right\rfloor.

By Proposition 3.2, any admissible UU satisfies ∣U−2V∣≤c=2−1/4\left|U-\sqrt{2}V\right| \le c=2^{-1/4}, so it lies in an interval of length 2c<22c<2; since consecutive odd numbers differ by 2, at most one odd UU can satisfy this condition for a given VV. Our program thus iterates over all valid values of VV and, for each VV, checks the unique odd UU (if it exists) that satisfies the conditions. It then sums GX(U,V)G_X(U,V) over all such pairs to compute the exact count of E. P. Stein numbers. At X=1028X=10^{28}, the bound is only 7,071,067 candidate values of VV, making the computation feasible; the results are summarized in Table 1.

XXExact S2(X)S_2(X)π−2X1/4log⁡X\pi^{-2}X^{1/4}\log XRatio
10410^4159.31.607
10810^8281186.61.506
101210^{12}3,3292,799.61.189
101610^{16}42,36737,328.11.135
102010^{20}543,144466,601.31.164
102410^{24}6,178,0055,599,215.51.103
102810^{28}70,201,70365,324,181.21.075

Table 1. Exact counts of E. P. Stein numbers compared with the leading asymptotic π−2X1/4log⁡X\pi^{-2}X^{1/4}\log X.

Table 1 created by the author, Cameron Rampell; the exact counts were computed with the author’s own Python implementation of the parameterization in Section 2. Produced in 2026.

When comparing the ratio of the exact counts to the predicted asymptotic values, we observe that the ratio tends to 1 as XX increases, but it does so in a nonmonotonic, oscillatory fashion. This suggests that by capturing the oscillations, an error term of order (log⁡X)−1(\log X)^{-1} may be best possible for the asymptotic formula.

Ratio of exact counts to the leading asymptotic

Figure 4. Ratio of exact counts to the leading asymptotic. The dashed horizontal line marks the limiting value 1. I input student-produced verified data to Astra, and Astra generated TikZ and PGFPlots code using said data. I manually adjusted the axis limits, tick marks, and plot styling for clarity and readability. Produced in 2026.

Remarks

In Richard Guy’s collection [5] of unsolved problems in number theory, Problem E26 asks whether the losing positions or the winning positions of Epstein’s game make up a positive-density subset of the positive integers. Our asymptotic settles this for the remoteness-2 positions: the E. P. Stein numbers form an infinite but density-zero subset of the positive integers, since

lim⁡X→∞S2(X)X=lim⁡X→∞(log⁡Xπ2X3/4+O(X−3/4))=0.\lim_{X \to\infty} \frac{S_2(X)}{X} = \lim_{X \to\infty} \left( \frac{\log X}{\pi^2 X^{3/4}} + O\left(X^{-3/4}\right) \right) = 0.

A related problem, A7(18), in Richard Nowakowski’s Unsolved Problems in Combinatorial Games [6] explicitly asks for asymptotic proportions of winning, losing, and draw positions. Although we have determined an asymptotic for remoteness-2 numbers, the general problem of asymptotic proportions for all positions remains open.

Further questions to investigate include whether O(X1/4)O(X^{1/4}) is the best error obtainable and whether useful arithmetic characterizations exist for positions of higher remoteness in Epstein’s game.

References

References

  1. [1]E. R. Berlekamp, J. H. Conway, and R. K. Guy, Winning Ways for Your Mathematical Plays, Volume 3, 2nd edition. A K Peters, 2003.
  2. [2]J. Steuding and K. Volkert, “A Diophantine Problem Related to a Nim-like Game,” Integers 19, Article G2, 2019.DOI
  3. [3]OEIS Foundation Inc., “E. P. Stein numbers, entry A397453 in the On-Line Encyclopedia of Integer Sequences.” https://oeis.org/A397453, 2026. Sequence proposed by C. Rampell.
  4. [4]A. Y. Khinchin, Continued Fractions. Dover Publications, 1997.
  5. [5]R. K. Guy, Unsolved Problems in Number Theory, 2nd edition. Springer-Verlag, 1994.
  6. [6]R. Nowakowski, “Unsolved problems in combinatorial games,” in Games of No Chance 6, Cambridge University Press, 2025.

Paper details

vlnc:W_qjmcbfcg
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Mathematics

Not recorded for this paper

View statement
Looking for related papers…
Contents