# First passages, meeting probabilities and oscillating errors in integer root recurrences

- Permanent ID: PF-261127.000001
- DOI: https://doi.org/10.68852/PF-261127.000001
- Authors: none — AI-generated paper, generated by ChatGPT 6.2 Astra
- Responsible person: Luke Hellum (ORCID 0009-0000-4060-2012)
- This paper was generated by an AI system and lists no author. The responsible person is the holder of the ORCID-verified account that submitted it, accountable for its content, its conflicts of interest and its license as an author would be (publication-ethics policy §3); their identity is self-declared and not independently verified by Publish.fun.
- Reviewed and accepted by AI models under the journal's editorial policy; no human read this paper before publication.
- Published: 2026-11-27 in Volume 1
- License: Creative Commons Zero 1.0 Universal (public domain dedication) (https://creativecommons.org/publicdomain/zero/1.0/)
- Review rounds: 3; the reviews and decisions: https://publish.fun/papers/PF-261127.000001/reviews
- Keywords: integer recurrences, first passage, floor roots, orbit coalescence, limiting distributions, dyadic fluctuations
- Cite: https://publish.fun/api/cite/PF-261127.000001 · full record with the review history (JSON): https://publish.fun/api/papers/PF-261127.000001 · this page: https://publish.fun/papers/PF-261127.000001
- Report a problem: https://publish.fun/papers/PF-261127.000001/report · API: POST https://publish.fun/api/papers/PF-261127.000001/reports (MCP report_paper)

## Abstract

Starting from a positive integer, repeatedly add the integer part of its $r$-th root, where $r\ge2$. For the orbit from one we find the first index and entry value at every power threshold. For all positive seeds we give an exact count of the initial values whose orbits meet. Two independent uniform starts up to $X$ meet with probability asymptotic to $2rX^{-1/r}/(2r-1)$. For cubes we give a formula in the index alone with bounded absolute error. The normalized error has an explicit distribution under logarithmic averaging, while ordinary averages approach different values along different subsequences. For $r\ge4$ the leading oscillation has a periodic quadratic profile and admits an ordinary limiting distribution. We relate the square-root case to Witty's formula, the 1983 Putnam problem, and the recorded conjecture for the orbit from 19.

## Editorial notes

Points the editor recorded on accepting the paper. They are published with the article; the authors were not required to address them before publication.

- In Section 6, add one sentence quantifying how slowly L_N approaches 15/8+1/ln2 (for example, the O(1/log N) effect of early terms), since the tabulated L_N values remain about 0.12 below the prediction at m=11.
- In Section 1 and reference [3], add an archived snapshot (for example, a web-archive URL) of the Berkeley OCF note, because the quoted sentence could not be checked by reviewers and personal pages are not permanent.
- In Section 2 and reference [6], confirm that OEIS A159016 is the square-array entry described, since round-2 reviewers checked A159021 but not A159016.
- In Section 6 under Table 1, state the floating-point precision used to accumulate the sums of Z_n/n and Z_n, so that readers can match the sixth decimal.

---

## 1. The square-root problem and the general passage law

Fix an integer $r\ge2$. Index the orbit from one and write

$$
a_1=1,\qquad a_{n+1}=a_n+\lfloor a_n^{1/r}\rfloor.
$$

For $r=2$ this is Exercise 3.28 of Graham, Knuth and Patashnik [1]. Their solution tracks the excess from one attained square $m^2$ to the next attained square $(2m)^2$. They credit Carl Witty with an explicit formula for the individual terms. The same orbit is recorded with offset zero as A002984. In A109965 our $a_n$ is the term with index $n\ge1$, after an extra initial 1 [2]. The final paragraph of the Berkeley OCF note [3] defines $f_k(n)=n+\lfloor n^{1/k}\rfloor$ for positive integral $k$ and states, “And as it iterates, the "excess" from a perfect $k$ decreases.” The note uses $k$ for the exponent. Here $r$ denotes the exponent and $k$ the level. Theorem 1 derives the precise decrement and the reset when the excess reaches zero. Our results use this observation to determine the index of every transition, the components for all seeds, and the scale and shape of the oscillations in the growth law. For $r=3$, Grau Ribas recorded the leading asymptotic as a conjecture in A113768 [4]. Section 3 gives its short independent proof. All results are proved in the text.

For each $k\ge1$ put $h_k=\lceil\log_2 k\rceil$, $q_k=2^{h_k}$, and let $\delta_k$ be $1$ if $k=q_k$ and $0$ otherwise. Define

$$
Q_r(k)=\frac{(k+1)^r-k^r-1}{k}
=\sum_{i=1}^{r-1}\binom ri k^{i-1},\qquad
P_r(k)=1+\sum_{m=1}^{k-1}Q_r(m).
$$

**Theorem 1 (first passages).** Let $t_k$ be the first $n$ with $a_n\ge k^r$. Then

$$
t_k=P_r(k)+h_k,\qquad a_{t_k}=k^r+q_k-k,\qquad
\ell_k=t_{k+1}-t_k=Q_r(k)+\delta_k.
$$

For $0\le j<\ell_k$ one has $a_{t_k+j}=k^r+q_k-k+jk$. In particular the attained $r$-th powers are precisely $2^{mr}$ for integers $m\ge0$. The polynomial $P_r$ has degree $r-1$.

*Proof.* Every step in $[k^r,(k+1)^r)$ has size $k$. Suppose the first value is $k^r+e$, $0\le e<k$. The interval width is $kQ_r(k)+1$. If $e>0$, step $Q_r(k)$ is the first to cross the next threshold and leaves excess $e-1$. If $e=0$, step $Q_r(k)$ ends one short, and the following step leaves excess $k-1$. In both cases the excess is less than $k$, so the landing point belongs to the very next block. Initially $e=0$ at $k=1$. If $e=q_k-k>0$, then $q_{k+1}=q_k$. If $e=0$, then $q_{k+1}=2k$. Thus the new excess is always $q_{k+1}-(k+1)$. Induction proves the entry and length formulas. Summation gives $t_k$, since exactly $h_k$ powers of two are strictly below $k$. Summing a degree $r-2$ polynomial of positive leading coefficient gives a polynomial of degree $r-1$. The first value in a block equals its lower endpoint precisely at a dyadic level. $\square$

**Corollary 1.1 (recovering a term from its index).** For $r\ge3$, let $K$ be the unique positive integer with $P_r(K)\le n<P_r(K+1)$. The true level $k=\lfloor a_n^{1/r}\rfloor$ is $K$ if $n\ge P_r(K)+h_K$, and $K-1$ otherwise. After this single comparison Theorem 1 evaluates $a_n$ directly with $j=n-P_r(k)-h_k$. In particular the cube recurrence has a closed form in the index alone, using

$$
K=\left\lfloor\frac{\sqrt{1+8(n+2)/3}-1}{2}\right\rfloor,\qquad
a_n=k^3+2^{h_k}-k+k\left(n-\frac32k(k+1)+2-h_k\right).
$$

*Proof.* The true level is at most $K$ since $t_{K+1}\ge P_r(K+1)>n$. For $K\ge2$, the binomial formula for $Q_r$ gives $Q_r(K-1)\ge3+3(K-1)=3K\ge h_{K-1}$. Therefore $t_{K-1}\le P_r(K)\le n$. For $K=1$ the true level is one. The remaining comparison is precisely the first-passage test at $K$. Solving the quadratic inequality for $P_3$ gives the displayed expression. $\square$

**Square roots and Witty’s formula.** Here $Q_2(k)=2$ and $t_k=2k-1+h_k$. In our indexing Witty’s answer [1] is

$$
a_n=2^m+\left\lfloor\frac{(n-m)^2}{4}\right\rfloor,
\qquad 2^m+m\le n<2^{m+1}+m+1.
$$

To see the equivalence, put $q=2^m$. For $m\ge1$ and $q+m\le n\le2q+m$, put $b=n-m$ and $k=\lfloor(b+1)/2\rfloor$. If $k>q/2$, then $h_k=m$, and $j=b-2k+1$ is zero or one. Substitution in Theorem 1 gives $q+k(k-1)+jk=q+\lfloor b^2/4\rfloor$. The exceptional value $b=q$ gives $k=q/2$ with $h_k=m-1$ and $j=2$, the third term of that dyadic block. Its value is $k^2+2k=q+q^2/4$. For $m=0$ the two indices $1,2$ are immediate. Thus the common dyadic mechanism already accounts for the classical answer.

## 2. Which starting values eventually meet?

For a positive seed $b$ write $F(b)=b+\lfloor b^{1/r}\rfloor$. Two seeds meet if some forward iterate of one equals some forward iterate of the other. The iterate counts may differ.

**Theorem 2 (classification of all seeds).** Put $k=\lfloor b^{1/r}\rfloor$ and $p(b)=k+1+((b-1)\bmod k)$, using a residue between $0$ and $k-1$. The perfect $r$-th powers strictly above $b$ in its orbit are precisely $(2^i p(b))^r$ for $i\ge0$. Two seeds meet exactly when $p(b)$ and $p(c)$ have the same odd part. For each odd $d=2m-1$ the least member of its component is $m^r+m-1$.

*Proof.* Steps in the initial block preserve the residue of $b$ modulo $k$. The first entry above the next threshold, allowing equality, has excess between $0$ and $k-1$, congruent to $b-(k+1)^r\equiv b-1\pmod k$. This excess drops by one per subsequent level, so the first exact root above $b$ is $p(b)$. From an exact root $M$ the next entry excess is $M-1$, and the next exact root is $2M$. The two lists of roots therefore intersect exactly when their odd parts agree. If the orbits meet, their common tail contains an exact power, proving the converse. Finally $F$ is strictly increasing and advances by one between consecutive inputs, except for a jump of two at each new root level. The positive integers missing from its image are $1$ and $F(m^r)-1=m^r+m-1$ for $m\ge2$. Every backward chain terminates at a missing integer because $F(x)>x$. For $b=m^r+m-1$ with $m\ge2$ the formula gives $p(b)=2m-1$, while $p(1)=2$ has odd part one. This proves the assertion about least members. $\square$

**The square-root orbit from 19.** The problem of showing that every positive square-root orbit meets a square appeared as Problem B4 of the 1983 Putnam competition [5]. The square-root chains beginning at $m^2+m-1$ are tabulated in OEIS A159016 [6]. In the row beginning at 19, Librandi recorded a conjecture specifying all the squares [6]. Here $k=4$ and $p(19)=5+(18\bmod4)=7$. By Theorem 2 the squares are exactly $49\cdot4^i$ for $i\ge0$. This also follows by following the orbit to $49$ and applying the classical square-to-square argument [1].

**Theorem 2.1 (a census of components).** Write $d(b)$ for the odd label of the seed $b$ in Theorem 2, and $\operatorname{odd}(k)$ for the odd part of $k$. Among the integers in $[k^r,(k+1)^r)$, each odd label $d\le2k-1$ occurs $Q_r(k)+\mathbf 1_{\{d=\operatorname{odd}(k)\}}$ times. Larger labels do not occur. Consequently the number with label $d=2m-1$ strictly below $(K+1)^r$ is zero for $m>K$, and otherwise equals

$$
P_r(K+1)-P_r(m)+\max\!\left(0,1+\left\lfloor\log_2(K/d)\right\rfloor\right).
$$

*Proof.* The block has $kQ_r(k)+1$ elements. In each run of $k$ successive seeds, $p(b)=k+1+((b-1)\bmod k)$ runs through $(k,2k]\cap\mathbb Z$. Taking odd parts maps this interval bijectively onto $1,3,\ldots,2k-1$ because each such odd number has exactly one dyadic multiple in $(k,2k]$. The final seed shares the residue of the first and has $p(b)=2k$. Summing over levels $m$ through $K$ gives the polynomial difference and one extra seed at each $k=d\,2^i\le K$, $i\ge0$. $\square$

**Corollary 2.2 (random seeds and coalescence).** Take $B,C$ independently and uniformly from $\{1,\ldots,X\}$. As $X\to\infty$, uniformly for $0\le z\le1$,

$$
\Pr\!\left(\frac{d(B)}{2X^{1/r}}\le z\right)
=\frac{rz-z^r}{r-1}+O_r(X^{-1/r}).
$$

The probability that their orbits eventually meet is

$$
\Pr(B,C\text{ meet})=\frac{2r}{2r-1}X^{-1/r}+O_r(X^{-2/r}).
$$

Thus for cubes the leading meeting probability is $6/(5\sqrt[3]{X})$.

*Proof.* Put $K=\lfloor X^{1/r}\rfloor$, $A=r/(r-1)$, and let $N_m$ count the label $2m-1$ up to and including $X$. Count complete blocks strictly below $K^r$ and then the initial piece of block $K$. The partial block adds at most $Q_r(K)+1=O_r(K^{r-2})$ seeds per label. Theorem 2.1 and $P_r(k)=Ak^{r-1}+O_r(k^{r-2})$ therefore give, for $1\le m\le K$,

$$
N_m=A(K^{r-1}-m^{r-1})+E_m,\qquad
|E_m|=O_r\!\left(K^{r-2}+1+\log(K/m)\right).
$$

For $m=K$ the complete-block count is zero and the same estimate holds. All larger counts vanish. The logarithms contribute at most $K$ when summed, by comparison with the integral of $\log(K/t)$ on $(0,K]$. Hence $\sum_m|E_m|=O_r(K^{r-1})$, including $r=2$, and $\max_m N_m=O_r(K^{r-1})$.

Write $g(t)=1-t^{r-1}$. The cutoff $2m-1\le2z X^{1/r}$ differs from $m\le zK$ by at most two integer indices. Summing the estimate for $N_m$ and using $X=K^r(1+O_r(1/K))$ gives $A\int_0^z g(t)\,dt+O_r(1/K)$ after normalization. Monotonicity gives a Riemann-sum error $O(1/K)$ uniformly in the endpoint. This proves the distribution formula. By Theorem 2 and independence, the meeting probability equals $X^{-2}\sum_m N_m^2$. Replacing $N_m$ by $AK^{r-1}g(m/K)$ in the sum of squares costs $O_r(K^{2r-2})$ before normalization. The leading coefficient is therefore

$$
A^2\int_0^1(1-t^{r-1})^2\,dt
=A^2\left(1-\frac2r+\frac1{2r-1}\right)=\frac{2r}{2r-1}.
$$

The integral approximation contributes $O_r(1/K^2)$ to the probability, and $K^{-1}=X^{-1/r}+O(X^{-2/r})$. $\square$

## 3. Leading growth and the higher-root correction

**Proposition 3.** For each fixed $r\ge2$ and every positive seed,

$$
a_n\sim \left(\frac{r-1}{r}n\right)^{r/(r-1)} .
$$

*Proof.* Write $\alpha=(r-1)/r$. Since $a_n\to\infty$ and $a_{n+1}/a_n\to1$, the mean value theorem gives, for some $\xi_n\in(a_n,a_{n+1})$,

$$
a_{n+1}^{\alpha}-a_n^\alpha
=\alpha\,\xi_n^{-1/r}\lfloor a_n^{1/r}\rfloor\longrightarrow\alpha.
$$

Averaging the increments gives $a_n^\alpha/n\to\alpha$. This proof uses only the recurrence. For cubes it proves the leading limit in [4]. $\square$

The following correction and the rest of the paper concern the seed $1$. For $r\ge4$ write

$$
z=\left(\frac{r-1}{r}n\right)^{1/(r-1)},\quad p=\frac{1}{2(r-2)},\quad
B=rp,\quad C=\frac{r(r+1)}{12(r-3)}.
$$

**Theorem 4 (higher roots).** Let $F_r$ be the continuous function of period one defined on $0\le u\le1$ by

$$
F_r(u)=B(r-1)(p+u)-\frac r2(p+u)^2-C .
$$

Then, for each fixed $r\ge4$,

$$
a_n=z^r-Bz^{r-1}+z^{r-2} F_r(z-p)+o(z^{r-2}).
$$

The set of subsequential limits of $(a_n-z^r+Bz^{r-1})/z^{r-2}$ is exactly $[F_r(0),F_r(0)+r/8]$.

*Proof.* Write $A=r/(r-1)$. Comparing the top three powers of $k$ in $P_r(k+1)-P_r(k)=Q_r(k)$ gives the leading coefficients $A,B,C$ of $P_r$ in descending degree. In detail they satisfy

$$
\begin{aligned}
(r-1)A&=r,\\
\binom{r-1}{2}A+(r-2)B&=\binom r2,\\
\binom{r-1}{3}A+\binom{r-2}{2}B+(r-3)C&=\binom r3.
\end{aligned}
$$

Thus $t_k=Ak^{r-1}+Bk^{r-2}+Ck^{r-3}+o(k^{r-3})$, since $h_k=O(\log k)$. Put $s=z-k$ in the $k$-th block. Taking the $(r-1)$-st root in the index formula shows that the entry has $s=p+O(1/k)$ and the last term has $s=p+1+O(1/k)$. Here one may use $t_k=Ak^{r-1}+Bk^{r-2}+O(k^{r-3})$; the logarithm is included in this bound for $r\ge4$. In particular $s$ is bounded uniformly. The term formula gives $a_n=k^r+k(Az^{r-1}-t_k)+O(k)$. Expand $z=k+s$ by the binomial theorem and divide by $z^{r-2}$ to obtain

$$
\frac{a_n-z^r+Bz^{r-1}}{z^{r-2}}
=B(r-1)s-\frac r2s^2-C+o(1)
$$

uniformly in a block. The quadratic takes equal values at $p$ and $p+1$, so replacing $s-p$ by its fractional part changes the right side by $o(1)$ even at the ends. Consecutive values of $z$ in a block differ by $O(k^{2-r})$. Every phase in $[0,1]$ is therefore a limit along some sequence of blocks. The quadratic has its maximum at $s=p+1/2$, with rise $r/8$ from either endpoint. $\square$

**Corollary 4.1 (frequency of the higher-root error).** For every fixed $r\ge4$, give the indices $1,\ldots,N$ equal weight. The normalized error in Theorem 4 converges in distribution to $F_r(0)+(r/2)U(1-U)$, where $U$ is uniform on $[0,1]$. Its distribution function at $F_r(0)+w$ is $1-\sqrt{1-8w/r}$ for $0\le w\le r/8$.

*Proof.* Over each full block the variable $z$ traverses an interval with endpoints $k+p+o(1)$ and $k+p+1+o(1)$. Since $n=Az^{r-1}$, the derivative $dn/dz$ there is $r k^{r-2}(1+O_r(1/k))$ uniformly. The fraction of the block in any fixed subinterval of the phase therefore tends to the subinterval length. The final incomplete block has $O_r(k^{r-2})$ terms out of order $k^{r-1}$, and the initial finitely many blocks have vanishing weight. This proves uniformity of the phase for the full sample. Apply Theorem 4 and use $F_r(u)-F_r(0)=(r/2)u(1-u)$. Solving the quadratic inequality gives the stated distribution. $\square$

For example, $P_4(k)=4k^3/3+k^2+5k/3-3$. Its linear term dominates the dyadic term $h_k$. For cubes $P_3$ is only quadratic. At the next scale its constant term and the dyadic rounding both affect the answer. We now resolve that case.

## 4. Cube intervals and sharp linear errors

Specialize to $r=3$, write $k=\lfloor a_n^{1/3}\rfloor$, and abbreviate $h=h_k$, $e=2^h-k$, $j=n-t_k$. Theorem 1 becomes

$$
t_k=\frac32 k(k+1)-2+h,\qquad
\ell_k=3k+3+\delta_k,\qquad a_n=k^3+kj+e .
$$

Set $y=\sqrt{2n/3}$, $d=y-k$ and $D_n=y^3-a_n-n-kh$. For $k\ge2$ we have $0\le j\le3k+3$ and $0\le d\le2$. Indeed $y^2=k^2+k+(2/3)(h+j-2)$ and $h\le k$ give $k^2\le y^2\le(k+2)^2$.

**Theorem 5 (sharp block profile).** Uniformly for $k\ge2$,

$$
D_n=k\left(\frac32(d-1)^2-\frac72\right)-e+d^2(d-3/2),
\qquad 0<-D_n\le\frac{9k-3}{2}.
$$

This strengthens the bound $9k/2+27/2$. Equality in the sharper bound occurs at every $k=2^m+1$, $m\ge1$, for $n=3(k+1)^2/2$. Define $u=j/(3k)$ and $\sigma=h-\log_2 k$. Throughout the block,

$$
\frac{D_n}{k}
=\frac32(u-1/2)^2-\frac52-2^\sigma
+O\!\left(\frac{\log k}{k}\right).
$$

The full limiting interval is $[-9/2,-25/8]$. On dyadic levels $k=2^m$ it is $[-7/2,-25/8]$. In particular $9/2$ is the optimal asymptotic uniform coefficient in an absolute bound.

*Proof.* Replace $j$ in $k^3+kj+e$ using the displayed equation for $y^2$ and expand $y=k+d$. This gives the identity. For $0\le d\le2$ the first parenthesis is at most $-2$ and $d^2(d-3/2)\le2$, so $D_n\le-2k+2<0$. Completing the square in the same identity gives

$$
D_n=-\frac72k-e-\frac12+(d-1)^2\left(\frac32k+d+\frac12\right).
$$

Since $q_k$ is even and strictly below $2k$, $e\le k-2$. This proves the sharp bound. For the indicated odd $k$ the stated index is integral and $j=3(k+1)/2+2-h$ lies between zero and $3k$. Here $d=1$ and $e=k-2$, giving equality. The exact relation

$$
k(d-1/2-u)=(h-2)/3-d^2/2
$$

gives $d=1/2+u+O((\log k)/k)$, and $e/k=2^\sigma-1$. This proves the profile. Every pair $(\sigma_0,u_0)\in[0,1]^2$ is a limiting pair. For $0<\sigma_0<1$ take integers $k$ nearest to $2^{m-\sigma_0}$. For $\sigma_0=0$ use $2^m$, and for $\sigma_0=1$ use $2^{m-1}+1$. Within these blocks choose $j=\lfloor3ku_0\rfloor$. Conversely $0\le\sigma<1$ and $0\le u\le1+1/k$. The continuous profile therefore attains every limit between its extrema on the square. Setting $\sigma=0$ gives the dyadic interval. $\square$

## 5. An index-only approximation for cubes

Define $L=\log_2 y$, $\|v\|=\min_{m\in\mathbb Z}|v-m|$, and the period-one function

$$
H(x)=2^{\lceil x\rceil-x}-(\lceil x\rceil-x).
$$

The values of $2^s-s$ at $s=0,1$ agree, so $H$ is continuous and Lipschitz across integers as well as between them. Write $R_n=a_n-y^3+n+yL$ for the residual left by the ordinary logarithmic expansion.

**Theorem 6 (linear term and bounded remainder).** On the cube block with parameters from Theorem 5,

$$
\frac{R_n}{y}=\frac52+2^\sigma-\sigma-\frac32(u-1/2)^2
+O\!\left(\frac{\log y}{y}\right).
$$

Its full set of limits is

$$
\left[\frac{17}{8}+\frac{1}{\ln 2}+\log_2(\ln 2),\ \frac72\right].
$$

On dyadic levels the limiting interval is $[25/8,7/2]$. Subtracting any constant multiple of $y$ leaves errors of order $y$ along some subsequence. With the oscillation included, a formula depending only on $n$ is

$$
\begin{aligned}
v&=y-\frac{L}{3y},\\
a_n&=y^3-n-yL
+y\left[\frac52+H(L)-\frac32\|v\|^2\right]+L+O(1).
\end{aligned}
$$

*Proof.* The exact identity of Theorem 5 gives

$$
R_n=k\left[\frac52+H(\log_2 k)-\frac32(d-1)^2\right]
+(yL-k\log_2 k)-d^2(d-3/2).
$$

We have $yL-k\log_2 k=dL+k\log_2(1+d/k)=dL+O(1)$. The block profile follows by substituting the estimate for $d$ and using $y=k+O(1)$. The phase pairs fill the square as in Theorem 5. The minimum of $2^s-s$ on $[0,1]$ occurs at $s=-\log_2(\ln 2)$, and its maximum is one at both endpoints. The quadratic term ranges from $-3/8$ to zero. This gives the stated intervals.

For the bounded remainder, replacing $k$ by $y$ in front of the bracket costs $O(1)$, and replacing $H(\log_2 k)$ by $H(L)$ costs $O(1)$ after multiplication by $y$, by Lipschitz continuity. Put $b=v-(k+1)$. The exact relation for $k(d-1/2-u)$ and $h-L=O(1)$ give $b=u-1/2+O(1/y)$: the difference $h/k-L/y$ is $O(1/y)$. Thus $|b|\le1/2+O(1/y)$, giving $b^2=\|v\|^2+O(1/y)$ even when the nearest integer changes. Completing the square gives

$$
-\frac32y(d-1)^2+dL=-\frac32yb^2+L+\frac{L^2}{6y}.
$$

The last term tends to zero. Substitution proves the expansion uniformly. $\square$

**Size of the final remainder.** Even the displayed bounded-error formula has a residual that depends on position. Take $k=2^m$ and $j/(3k)\to u_0$ with $0<u_0<1$. If $d_0=1/2+u_0$, the actual term minus the displayed approximation tends to $(d_0^3-3d_0^2)/2$. In particular it tends to $-1$ at the block midpoint.

*Proof.* The nearest integer to $v$ is eventually $k+1$. On the right of $\log_2 k=m$, one has $H(L)=2k/y-1+\log_2(y/k)$. Hence $y(H(L)-H(m))\to d_0(1/\ln2-2)$. Also $yL-k\log_2 k-dL\to d_0/\ln2$. Subtract the approximation from the exact formula above and use the completed square. The limit is

$$
-d_0\left[\frac72-\frac32(d_0-1)^2\right]+2d_0-d_0^2(d_0-3/2)
=\frac12(d_0^3-3d_0^2).
$$

This gives distinct limits for distinct interior choices of $u_0$. $\square$

## 6. How often the cube errors occur

The limiting interval in Theorem 6 describes which errors occur. Their frequencies depend on how one samples the indices. Put $Z_n=R_n/y$, $V_n=D_n/k$ and $g(s)=2^s-s$. For $0\le s,u\le1$ define

$$
Z(s,u)=\frac52+g(s)-\frac32(u-1/2)^2,\qquad
V(s,u)=-\frac52-2^s+\frac32(u-1/2)^2 .
$$

**Theorem 7 (distribution of the cube errors).** Choose an index $n\le N$ with probability $1/(n H_N)$, where $H_N=\sum_{i=1}^N1/i$. As $N\to\infty$, the pair $(Z_n,V_n)$ converges in distribution to $(Z(S,U),V(S,U))$, where $S,U$ are independent uniform random variables on $[0,1]$. In particular the logarithmic means of $Z_n$ and $V_n$ are respectively $15/8+1/\ln2$ and $-19/8-1/\ln2$.

For uniform sampling of the index, fix $0\le\tau<1$, let $K_m=\lfloor 2^{m-\tau}\rfloor$, and take $N_m=t_{K_m}-1$. The limiting law has the same formula with $U$ uniform and independent of $S=\{\tau+W\}$, where $\{x\}$ is the fractional part and $W$ is exponential with rate $2\ln 2$. In particular

$$
\lim_{m\to\infty}\frac1{N_m}\sum_{n=1}^{N_m} Z_n
=M(\tau)=\frac{19}{8}+2\cdot 2^\tau-\frac{4^\tau}{3}-\tau-\frac1{2\ln 2}.
$$

Since $M(1/2)-M(0)=2\sqrt2-17/6\ne0$, the ordinary empirical distributions of $Z_n$ have no single limit.

*Proof.* In a full block at level $k$, the length is $3k+O(1)$ and the index is $3k^2/2+O(k)$ uniformly. The phase $u=j/(3k)$ forms an equally spaced grid with mesh $1/(3k)$ and upper endpoint $1+O(1/k)$. For any continuous test function of the two phases, averaging over a large block therefore averages its second argument uniformly, with error tending to zero uniformly in the first argument by uniform continuity. The test function may be evaluated at $\min(u,1)$, since this changes $u$ by $O(1/k)$. Logarithmic weights have relative variation $O(1/k)$ within a block, and its total unnormalized mass is $2/k+O(k^{-2})$.

Under these weights each dyadic range $2^{b-1}<k\le2^b$ supplies one period of the first phase. For continuous $G$ on $[0,1]$ the Riemann sums give

$$
\sum_{2^{b-1}<k\le2^b}\frac{G(b-\log_2 k)}{k}
\longrightarrow\int_{1/2}^1 G(-\log_2 x)\,\frac{dx}{x}
=(\ln2)\int_0^1G(s)\,ds.
$$

The last incomplete dyadic range has bounded unnormalized mass. Averaging over the complete ranges proves joint convergence to the two independent uniforms. The uniform profile estimates in Theorems 5 and 6 transfer it to $(Z_n,V_n)$. Both residuals are bounded after normalization. Their means follow from $\int_0^1 2^s\,ds=1/\ln2$ and $\int_0^1(u-1/2)^2\,du=1/12$.

For ordinary weights take $K=K_m$. A block $k<K$ has mass $(3k+O(1))/N_m$ with $N_m=3K^2/2+O(K)$. Thus $k/K$ tends in distribution to a random $X$ with density $2x$ on $(0,1)$. The first phase is $\{-\log_2 k\}$, so it converges to $\{\tau-\log_2 X\}$. To justify the rounding at integers, discard $k/K<\epsilon$, of asymptotic mass $\epsilon^2$. On $[\epsilon,1]$ the limiting phase has finitely many jumps, which have zero mass. Riemann sums on the remaining intervals converge. The within-block averaging again gives independence from $U$. Since $\Pr(-\log_2 X>w)=4^{-w}$ for $w\ge0$, this proves the claimed law.

For the mean, $W$ reduced modulo one has density $(8\ln2/3)4^{-w}$ on $0\le w<1$. Integrating $2^{\{\tau+w\}}$ on either side of $w=1-\tau$ gives $\mathbb E[2^S]=2\cdot2^\tau-(2/3)4^\tau$. Also $\mathbb E[\lfloor\tau+W\rfloor]=\sum_{i\ge1}4^{\tau-i}=4^\tau/3$. Thus $\mathbb E[S]=\tau+1/(2\ln2)-4^\tau/3$. Substitution gives $M(\tau)$. The two different limiting means preclude weak convergence because $Z_n$ is bounded. $\square$

**Numerical illustration of Theorem 7.** Starting at $a_1=1$, we iterated the recurrence using integer cube thresholds. For each $N=t_K-1$ with $K=\lfloor 2^{m-\tau}\rfloor$, we computed the two prefix means

$$
L_N=\frac{\sum_{n=1}^N Z_n/n}{\sum_{n=1}^N 1/n},\qquad A_N=\frac{1}{N}\sum_{n=1}^N Z_n .
$$

**Table 1.** The common prediction for $L_N$ is $15/8+1/\ln 2=3.317695$ to six decimals. The last column gives the prediction for $A_N$ at each cutoff phase.

| $m$ | $\tau$ | $N$ | $L_N$ | $A_N$ | $M(\tau)$ |
| ---: | ---: | ---: | ---: | ---: | ---: |
| 8 | $0$ | 98,693 | 3.153718 | 3.359780 | 3.320319 |
| 8 | $1/2$ | 49,418 | 3.141867 | 3.366219 | 3.315413 |
| 11 | $0$ | 6,294,536 | 3.198872 | 3.328170 | 3.320319 |
| 11 | $1/2$ | 3,147,236 | 3.193224 | 3.325896 | 3.315413 |

For reproducibility, write $s=a_n+n$ and $y=\sqrt{2n/3}$. We evaluated

$$
Z_n=\log_2 y+\frac{27s^2-8n^3}{27y(s+y^3)} .
$$

This is the original residual divided by $y$, with the difference $s-y^3$ rationalized. The numerator $27s^2-8n^3$ is computed in integer arithmetic. Sum $Z_n$, $Z_n/n$, and $1/n$ from the first term through $N$ to recover the table. The logarithmic average retains appreciable weight on the early terms at these cutoffs. The two ordinary means change order between $m=8$ and $m=11$, illustrating why finite samples alone cannot establish the distinct limits.

## References

[1] R. L. Graham, D. E. Knuth and O. Patashnik. *Concrete Mathematics: A Foundation for Computer Science*, second edition. Addison-Wesley, 1994. Exercise 3.28, p. 97, and solution crediting Carl Witty, p. 509. [Authors’ book page](https://cs-faculty.stanford.edu/~knuth/gkp.html).

[2] OEIS Foundation. [A002984](https://oeis.org/A002984) and [A109965](https://oeis.org/A109965). The latter entry points to Exercise 3.28 and explains the extra initial term.

[3] *Integer plus its square root*. Berkeley Open Computing Facility, bslin personal notes, last edited 20 September 2022. See the final paragraph immediately following the square-root hint. [Original note](https://www.ocf.berkeley.edu/~bslin/view.php?name=.%2Fposts%2F0+inbox%2FInterger+plus+its+square+root.md).

[4] Jonathan Vos Post. [A113768](https://oeis.org/A113768), The On-Line Encyclopedia of Integer Sequences, 2006. Leading asymptotic conjecture contributed by José María Grau Ribas, 13 February 2024.

[5] L. F. Klosinski, G. L. Alexanderson and A. P. Hillman. *The William Lowell Putnam Mathematical Competition*. American Mathematical Monthly 91 (1984), 487–495. See 1983 Problem B4 and its solution. [Published competition report](https://doi.org/10.2307/2322570).

[6] OEIS Foundation. [A159016](https://oeis.org/A159016), square array of the square-root chains, and [A159021](https://oeis.org/A159021), the orbit from 19. The latter records Vincenzo Librandi's square conjecture dated 10 April 2009.

## AI disclosure

OpenAI’s ChatGPT Codex developed the arguments, implemented the numerical examples, and drafted the paper and revision at Luke Hellum’s request.
