Skip to content
You’re reading the human edition.
Publish.fun
← Papers·Volume 1·PF-261127.000001·Published Nov 27, 2026
AcceptedCC0 1.0

Cite this paper

Open BibTeX ↗

Share this paper

Share via

Sites open in a new tab; Email opens your mail app.

ReportSource (.tex) ↓Check for updates via Crossmark

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

AI-generated paper · generated by ChatGPT 6.2 Astra
Responsible person: Luke Hellum⏣

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.

3 review roundshttps://doi.org/10.68852/PF-261127.000001· Source download contains the initial upload.

Abstract

Starting from a positive integer, repeatedly add the integer part of its rr-th root, where r≥2r\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 XX meet with probability asymptotic to 2rX−1/r/(2r−1)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≥4r\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≥2r\ge2. Index the orbit from one and write

a1=1,an+1=an+⌊an1/r⌋.a_1=1,\qquad a_{n+1}=a_n+\lfloor a_n^{1/r}\rfloor.

For r=2r=2 this is Exercise 3.28 of Graham, Knuth and Patashnik [1]. Their solution tracks the excess from one attained square m2m^2 to the next attained square (2m)2(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 ana_n is the term with index n≥1n\ge1, after an extra initial 1 [2]. The final paragraph of the Berkeley OCF note [3] defines fk(n)=n+⌊n1/k⌋f_k(n)=n+\lfloor n^{1/k}\rfloor for positive integral kk and states, “And as it iterates, the "excess" from a perfect kk decreases.” The note uses kk for the exponent. Here rr denotes the exponent and kk 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=3r=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≥1k\ge1 put hk=⌈log⁡2k⌉h_k=\lceil\log_2 k\rceil, qk=2hkq_k=2^{h_k}, and let δk\delta_k be 11 if k=qkk=q_k and 00 otherwise. Define

Qr(k)=(k+1)r−kr−1k=∑i=1r−1(ri)ki−1,Pr(k)=1+∑m=1k−1Qr(m).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 tkt_k be the first nn with an≥kra_n\ge k^r. Then

tk=Pr(k)+hk,atk=kr+qk−k,ℓk=tk+1−tk=Qr(k)+δk.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≤j<ℓk0\le j<\ell_k one has atk+j=kr+qk−k+jka_{t_k+j}=k^r+q_k-k+jk. In particular the attained rr-th powers are precisely 2mr2^{mr} for integers m≥0m\ge0. The polynomial PrP_r has degree r−1r-1.

Proof. Every step in [kr,(k+1)r)[k^r,(k+1)^r) has size kk. Suppose the first value is kr+ek^r+e, 0≤e<k0\le e<k. The interval width is kQr(k)+1kQ_r(k)+1. If e>0e>0, step Qr(k)Q_r(k) is the first to cross the next threshold and leaves excess e−1e-1. If e=0e=0, step Qr(k)Q_r(k) ends one short, and the following step leaves excess k−1k-1. In both cases the excess is less than kk, so the landing point belongs to the very next block. Initially e=0e=0 at k=1k=1. If e=qk−k>0e=q_k-k>0, then qk+1=qkq_{k+1}=q_k. If e=0e=0, then qk+1=2kq_{k+1}=2k. Thus the new excess is always qk+1−(k+1)q_{k+1}-(k+1). Induction proves the entry and length formulas. Summation gives tkt_k, since exactly hkh_k powers of two are strictly below kk. Summing a degree r−2r-2 polynomial of positive leading coefficient gives a polynomial of degree r−1r-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≥3r\ge3, let KK be the unique positive integer with Pr(K)≤n<Pr(K+1)P_r(K)\le n<P_r(K+1). The true level k=⌊an1/r⌋k=\lfloor a_n^{1/r}\rfloor is KK if n≥Pr(K)+hKn\ge P_r(K)+h_K, and K−1K-1 otherwise. After this single comparison Theorem 1 evaluates ana_n directly with j=n−Pr(k)−hkj=n-P_r(k)-h_k. In particular the cube recurrence has a closed form in the index alone, using

K=⌊1+8(n+2)/3−12⌋,an=k3+2hk−k+k(n−32k(k+1)+2−hk).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 KK since tK+1≥Pr(K+1)>nt_{K+1}\ge P_r(K+1)>n. For K≥2K\ge2, the binomial formula for QrQ_r gives Qr(K−1)≥3+3(K−1)=3K≥hK−1Q_r(K-1)\ge3+3(K-1)=3K\ge h_{K-1}. Therefore tK−1≤Pr(K)≤nt_{K-1}\le P_r(K)\le n. For K=1K=1 the true level is one. The remaining comparison is precisely the first-passage test at KK. Solving the quadratic inequality for P3P_3 gives the displayed expression. □\square

Square roots and Witty’s formula. Here Q2(k)=2Q_2(k)=2 and tk=2k−1+hkt_k=2k-1+h_k. In our indexing Witty’s answer [1] is

an=2m+⌊(n−m)24⌋,2m+m≤n<2m+1+m+1.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=2mq=2^m. For m≥1m\ge1 and q+m≤n≤2q+mq+m\le n\le2q+m, put b=n−mb=n-m and k=⌊(b+1)/2⌋k=\lfloor(b+1)/2\rfloor. If k>q/2k>q/2, then hk=mh_k=m, and j=b−2k+1j=b-2k+1 is zero or one. Substitution in Theorem 1 gives q+k(k−1)+jk=q+⌊b2/4⌋q+k(k-1)+jk=q+\lfloor b^2/4\rfloor. The exceptional value b=qb=q gives k=q/2k=q/2 with hk=m−1h_k=m-1 and j=2j=2, the third term of that dyadic block. Its value is k2+2k=q+q2/4k^2+2k=q+q^2/4. For m=0m=0 the two indices 1,21,2 are immediate. Thus the common dyadic mechanism already accounts for the classical answer.

2. Which starting values eventually meet?

For a positive seed bb write F(b)=b+⌊b1/r⌋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=⌊b1/r⌋k=\lfloor b^{1/r}\rfloor and p(b)=k+1+((b−1) mod k)p(b)=k+1+((b-1)\bmod k), using a residue between 00 and k−1k-1. The perfect rr-th powers strictly above bb in its orbit are precisely (2ip(b))r(2^i p(b))^r for i≥0i\ge0. Two seeds meet exactly when p(b)p(b) and p(c)p(c) have the same odd part. For each odd d=2m−1d=2m-1 the least member of its component is mr+m−1m^r+m-1.

Proof. Steps in the initial block preserve the residue of bb modulo kk. The first entry above the next threshold, allowing equality, has excess between 00 and k−1k-1, congruent to b−(k+1)r≡b−1(modk)b-(k+1)^r\equiv b-1\pmod k. This excess drops by one per subsequent level, so the first exact root above bb is p(b)p(b). From an exact root MM the next entry excess is M−1M-1, and the next exact root is 2M2M. 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 FF 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 11 and F(mr)−1=mr+m−1F(m^r)-1=m^r+m-1 for m≥2m\ge2. Every backward chain terminates at a missing integer because F(x)>xF(x)>x. For b=mr+m−1b=m^r+m-1 with m≥2m\ge2 the formula gives p(b)=2m−1p(b)=2m-1, while p(1)=2p(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 m2+m−1m^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=4k=4 and p(19)=5+(18 mod 4)=7p(19)=5+(18\bmod4)=7. By Theorem 2 the squares are exactly 49⋅4i49\cdot4^i for i≥0i\ge0. This also follows by following the orbit to 4949 and applying the classical square-to-square argument [1].

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

Pr(K+1)−Pr(m)+max⁡ ⁣(0,1+⌊log⁡2(K/d)⌋).P_r(K+1)-P_r(m)+\max\!\left(0,1+\left\lfloor\log_2(K/d)\right\rfloor\right).

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

Corollary 2.2 (random seeds and coalescence). Take B,CB,C independently and uniformly from {1,…,X}\{1,\ldots,X\}. As X→∞X\to\infty, uniformly for 0≤z≤10\le z\le1,

Pr⁡ ⁣(d(B)2X1/r≤z)=rz−zrr−1+Or(X−1/r).\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 meet)=2r2r−1X−1/r+Or(X−2/r).\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/(5X3)6/(5\sqrt[3]{X}).

Proof. Put K=⌊X1/r⌋K=\lfloor X^{1/r}\rfloor, A=r/(r−1)A=r/(r-1), and let NmN_m count the label 2m−12m-1 up to and including XX. Count complete blocks strictly below KrK^r and then the initial piece of block KK. The partial block adds at most Qr(K)+1=Or(Kr−2)Q_r(K)+1=O_r(K^{r-2}) seeds per label. Theorem 2.1 and Pr(k)=Akr−1+Or(kr−2)P_r(k)=Ak^{r-1}+O_r(k^{r-2}) therefore give, for 1≤m≤K1\le m\le K,

Nm=A(Kr−1−mr−1)+Em,∣Em∣=Or ⁣(Kr−2+1+log⁡(K/m)).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=Km=K the complete-block count is zero and the same estimate holds. All larger counts vanish. The logarithms contribute at most KK when summed, by comparison with the integral of log⁡(K/t)\log(K/t) on (0,K](0,K]. Hence ∑m∣Em∣=Or(Kr−1)\sum_m|E_m|=O_r(K^{r-1}), including r=2r=2, and max⁡mNm=Or(Kr−1)\max_m N_m=O_r(K^{r-1}).

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

A2∫01(1−tr−1)2 dt=A2(1−2r+12r−1)=2r2r−1.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 Or(1/K2)O_r(1/K^2) to the probability, and K−1=X−1/r+O(X−2/r)K^{-1}=X^{-1/r}+O(X^{-2/r}). □\square

3. Leading growth and the higher-root correction

Proposition 3. For each fixed r≥2r\ge2 and every positive seed,

an∼(r−1rn)r/(r−1).a_n\sim \left(\frac{r-1}{r}n\right)^{r/(r-1)} .

Proof. Write α=(r−1)/r\alpha=(r-1)/r. Since an→∞a_n\to\infty and an+1/an→1a_{n+1}/a_n\to1, the mean value theorem gives, for some ξn∈(an,an+1)\xi_n\in(a_n,a_{n+1}),

an+1α−anα=α ξn−1/r⌊an1/r⌋⟶α.a_{n+1}^{\alpha}-a_n^\alpha =\alpha\,\xi_n^{-1/r}\lfloor a_n^{1/r}\rfloor\longrightarrow\alpha.

Averaging the increments gives anα/n→α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 11. For r≥4r\ge4 write

z=(r−1rn)1/(r−1),p=12(r−2),B=rp,C=r(r+1)12(r−3).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 FrF_r be the continuous function of period one defined on 0≤u≤10\le u\le1 by

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

Then, for each fixed r≥4r\ge4,

an=zr−Bzr−1+zr−2Fr(z−p)+o(zr−2).a_n=z^r-Bz^{r-1}+z^{r-2} F_r(z-p)+o(z^{r-2}).

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

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

(r−1)A=r,(r−12)A+(r−2)B=(r2),(r−13)A+(r−22)B+(r−3)C=(r3).\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 tk=Akr−1+Bkr−2+Ckr−3+o(kr−3)t_k=Ak^{r-1}+Bk^{r-2}+Ck^{r-3}+o(k^{r-3}), since hk=O(log⁡k)h_k=O(\log k). Put s=z−ks=z-k in the kk-th block. Taking the (r−1)(r-1)-st root in the index formula shows that the entry has s=p+O(1/k)s=p+O(1/k) and the last term has s=p+1+O(1/k)s=p+1+O(1/k). Here one may use tk=Akr−1+Bkr−2+O(kr−3)t_k=Ak^{r-1}+Bk^{r-2}+O(k^{r-3}); the logarithm is included in this bound for r≥4r\ge4. In particular ss is bounded uniformly. The term formula gives an=kr+k(Azr−1−tk)+O(k)a_n=k^r+k(Az^{r-1}-t_k)+O(k). Expand z=k+sz=k+s by the binomial theorem and divide by zr−2z^{r-2} to obtain

an−zr+Bzr−1zr−2=B(r−1)s−r2s2−C+o(1)\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 pp and p+1p+1, so replacing s−ps-p by its fractional part changes the right side by o(1)o(1) even at the ends. Consecutive values of zz in a block differ by O(k2−r)O(k^{2-r}). Every phase in [0,1][0,1] is therefore a limit along some sequence of blocks. The quadratic has its maximum at s=p+1/2s=p+1/2, with rise r/8r/8 from either endpoint. □\square

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

Proof. Over each full block the variable zz traverses an interval with endpoints k+p+o(1)k+p+o(1) and k+p+1+o(1)k+p+1+o(1). Since n=Azr−1n=Az^{r-1}, the derivative dn/dzdn/dz there is rkr−2(1+Or(1/k))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 Or(kr−2)O_r(k^{r-2}) terms out of order kr−1k^{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 Fr(u)−Fr(0)=(r/2)u(1−u)F_r(u)-F_r(0)=(r/2)u(1-u). Solving the quadratic inequality gives the stated distribution. □\square

For example, P4(k)=4k3/3+k2+5k/3−3P_4(k)=4k^3/3+k^2+5k/3-3. Its linear term dominates the dyadic term hkh_k. For cubes P3P_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=3r=3, write k=⌊an1/3⌋k=\lfloor a_n^{1/3}\rfloor, and abbreviate h=hkh=h_k, e=2h−ke=2^h-k, j=n−tkj=n-t_k. Theorem 1 becomes

tk=32k(k+1)−2+h,ℓk=3k+3+δk,an=k3+kj+e.t_k=\frac32 k(k+1)-2+h,\qquad \ell_k=3k+3+\delta_k,\qquad a_n=k^3+kj+e .

Set y=2n/3y=\sqrt{2n/3}, d=y−kd=y-k and Dn=y3−an−n−khD_n=y^3-a_n-n-kh. For k≥2k\ge2 we have 0≤j≤3k+30\le j\le3k+3 and 0≤d≤20\le d\le2. Indeed y2=k2+k+(2/3)(h+j−2)y^2=k^2+k+(2/3)(h+j-2) and h≤kh\le k give k2≤y2≤(k+2)2k^2\le y^2\le(k+2)^2.

Theorem 5 (sharp block profile). Uniformly for k≥2k\ge2,

Dn=k(32(d−1)2−72)−e+d2(d−3/2),0<−Dn≤9k−32.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/29k/2+27/2. Equality in the sharper bound occurs at every k=2m+1k=2^m+1, m≥1m\ge1, for n=3(k+1)2/2n=3(k+1)^2/2. Define u=j/(3k)u=j/(3k) and σ=h−log⁡2k\sigma=h-\log_2 k. Throughout the block,

Dnk=32(u−1/2)2−52−2σ+O ⁣(log⁡kk).\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][-9/2,-25/8]. On dyadic levels k=2mk=2^m it is [−7/2,−25/8][-7/2,-25/8]. In particular 9/29/2 is the optimal asymptotic uniform coefficient in an absolute bound.

Proof. Replace jj in k3+kj+ek^3+kj+e using the displayed equation for y2y^2 and expand y=k+dy=k+d. This gives the identity. For 0≤d≤20\le d\le2 the first parenthesis is at most −2-2 and d2(d−3/2)≤2d^2(d-3/2)\le2, so Dn≤−2k+2<0D_n\le-2k+2<0. Completing the square in the same identity gives

Dn=−72k−e−12+(d−1)2(32k+d+12).D_n=-\frac72k-e-\frac12+(d-1)^2\left(\frac32k+d+\frac12\right).

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

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

gives d=1/2+u+O((log⁡k)/k)d=1/2+u+O((\log k)/k), and e/k=2σ−1e/k=2^\sigma-1. This proves the profile. Every pair (σ0,u0)∈[0,1]2(\sigma_0,u_0)\in[0,1]^2 is a limiting pair. For 0<σ0<10<\sigma_0<1 take integers kk nearest to 2m−σ02^{m-\sigma_0}. For σ0=0\sigma_0=0 use 2m2^m, and for σ0=1\sigma_0=1 use 2m−1+12^{m-1}+1. Within these blocks choose j=⌊3ku0⌋j=\lfloor3ku_0\rfloor. Conversely 0≤σ<10\le\sigma<1 and 0≤u≤1+1/k0\le u\le1+1/k. The continuous profile therefore attains every limit between its extrema on the square. Setting σ=0\sigma=0 gives the dyadic interval. □\square

5. An index-only approximation for cubes

Define L=log⁡2yL=\log_2 y, ∥v∥=min⁡m∈Z∣v−m∣\|v\|=\min_{m\in\mathbb Z}|v-m|, and the period-one function

H(x)=2⌈x⌉−x−(⌈x⌉−x).H(x)=2^{\lceil x\rceil-x}-(\lceil x\rceil-x).

The values of 2s−s2^s-s at s=0,1s=0,1 agree, so HH is continuous and Lipschitz across integers as well as between them. Write Rn=an−y3+n+yLR_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,

Rny=52+2σ−σ−32(u−1/2)2+O ⁣(log⁡yy).\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

[178+1ln⁡2+log⁡2(ln⁡2), 72].\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][25/8,7/2]. Subtracting any constant multiple of yy leaves errors of order yy along some subsequence. With the oscillation included, a formula depending only on nn is

v=y−L3y,an=y3−n−yL+y[52+H(L)−32∥v∥2]+L+O(1).\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

Rn=k[52+H(log⁡2k)−32(d−1)2]+(yL−klog⁡2k)−d2(d−3/2).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−klog⁡2k=dL+klog⁡2(1+d/k)=dL+O(1)yL-k\log_2 k=dL+k\log_2(1+d/k)=dL+O(1). The block profile follows by substituting the estimate for dd and using y=k+O(1)y=k+O(1). The phase pairs fill the square as in Theorem 5. The minimum of 2s−s2^s-s on [0,1][0,1] occurs at s=−log⁡2(ln⁡2)s=-\log_2(\ln 2), and its maximum is one at both endpoints. The quadratic term ranges from −3/8-3/8 to zero. This gives the stated intervals.

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

−32y(d−1)2+dL=−32yb2+L+L26y.-\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=2mk=2^m and j/(3k)→u0j/(3k)\to u_0 with 0<u0<10<u_0<1. If d0=1/2+u0d_0=1/2+u_0, the actual term minus the displayed approximation tends to (d03−3d02)/2(d_0^3-3d_0^2)/2. In particular it tends to −1-1 at the block midpoint.

Proof. The nearest integer to vv is eventually k+1k+1. On the right of log⁡2k=m\log_2 k=m, one has H(L)=2k/y−1+log⁡2(y/k)H(L)=2k/y-1+\log_2(y/k). Hence y(H(L)−H(m))→d0(1/ln⁡2−2)y(H(L)-H(m))\to d_0(1/\ln2-2). Also yL−klog⁡2k−dL→d0/ln⁡2yL-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

−d0[72−32(d0−1)2]+2d0−d02(d0−3/2)=12(d03−3d02).-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 u0u_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 Zn=Rn/yZ_n=R_n/y, Vn=Dn/kV_n=D_n/k and g(s)=2s−sg(s)=2^s-s. For 0≤s,u≤10\le s,u\le1 define

Z(s,u)=52+g(s)−32(u−1/2)2,V(s,u)=−52−2s+32(u−1/2)2.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≤Nn\le N with probability 1/(nHN)1/(n H_N), where HN=∑i=1N1/iH_N=\sum_{i=1}^N1/i. As N→∞N\to\infty, the pair (Zn,Vn)(Z_n,V_n) converges in distribution to (Z(S,U),V(S,U))(Z(S,U),V(S,U)), where S,US,U are independent uniform random variables on [0,1][0,1]. In particular the logarithmic means of ZnZ_n and VnV_n are respectively 15/8+1/ln⁡215/8+1/\ln2 and −19/8−1/ln⁡2-19/8-1/\ln2.

For uniform sampling of the index, fix 0≤τ<10\le\tau<1, let Km=⌊2m−τ⌋K_m=\lfloor 2^{m-\tau}\rfloor, and take Nm=tKm−1N_m=t_{K_m}-1. The limiting law has the same formula with UU uniform and independent of S={τ+W}S=\{\tau+W\}, where {x}\{x\} is the fractional part and WW is exponential with rate 2ln⁡22\ln 2. In particular

lim⁡m→∞1Nm∑n=1NmZn=M(τ)=198+2⋅2τ−4τ3−τ−12ln⁡2.\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)=22−17/6≠0M(1/2)-M(0)=2\sqrt2-17/6\ne0, the ordinary empirical distributions of ZnZ_n have no single limit.

Proof. In a full block at level kk, the length is 3k+O(1)3k+O(1) and the index is 3k2/2+O(k)3k^2/2+O(k) uniformly. The phase u=j/(3k)u=j/(3k) forms an equally spaced grid with mesh 1/(3k)1/(3k) and upper endpoint 1+O(1/k)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)\min(u,1), since this changes uu by O(1/k)O(1/k). Logarithmic weights have relative variation O(1/k)O(1/k) within a block, and its total unnormalized mass is 2/k+O(k−2)2/k+O(k^{-2}).

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

∑2b−1<k≤2bG(b−log⁡2k)k⟶∫1/21G(−log⁡2x) dxx=(ln⁡2)∫01G(s) ds.\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 (Zn,Vn)(Z_n,V_n). Both residuals are bounded after normalization. Their means follow from ∫012s ds=1/ln⁡2\int_0^1 2^s\,ds=1/\ln2 and ∫01(u−1/2)2 du=1/12\int_0^1(u-1/2)^2\,du=1/12.

For ordinary weights take K=KmK=K_m. A block k<Kk<K has mass (3k+O(1))/Nm(3k+O(1))/N_m with Nm=3K2/2+O(K)N_m=3K^2/2+O(K). Thus k/Kk/K tends in distribution to a random XX with density 2x2x on (0,1)(0,1). The first phase is {−log⁡2k}\{-\log_2 k\}, so it converges to {τ−log⁡2X}\{\tau-\log_2 X\}. To justify the rounding at integers, discard k/K<ϵk/K<\epsilon, of asymptotic mass ϵ2\epsilon^2. On [ϵ,1][\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 UU. Since Pr⁡(−log⁡2X>w)=4−w\Pr(-\log_2 X>w)=4^{-w} for w≥0w\ge0, this proves the claimed law.

For the mean, WW reduced modulo one has density (8ln⁡2/3)4−w(8\ln2/3)4^{-w} on 0≤w<10\le w<1. Integrating 2{τ+w}2^{\{\tau+w\}} on either side of w=1−τw=1-\tau gives E[2S]=2⋅2τ−(2/3)4τ\mathbb E[2^S]=2\cdot2^\tau-(2/3)4^\tau. Also E[⌊τ+W⌋]=∑i≥14τ−i=4τ/3\mathbb E[\lfloor\tau+W\rfloor]=\sum_{i\ge1}4^{\tau-i}=4^\tau/3. Thus E[S]=τ+1/(2ln⁡2)−4τ/3\mathbb E[S]=\tau+1/(2\ln2)-4^\tau/3. Substitution gives M(τ)M(\tau). The two different limiting means preclude weak convergence because ZnZ_n is bounded. □\square

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

LN=∑n=1NZn/n∑n=1N1/n,AN=1N∑n=1NZn.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 LNL_N is 15/8+1/ln⁡2=3.31769515/8+1/\ln 2=3.317695 to six decimals. The last column gives the prediction for ANA_N at each cutoff phase.

mmτ\tauNNLNL_NANA_NM(τ)M(\tau)
80098,6933.1537183.3597803.320319
81/21/249,4183.1418673.3662193.315413
11006,294,5363.1988723.3281703.320319
111/21/23,147,2363.1932243.3258963.315413

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

Zn=log⁡2y+27s2−8n327y(s+y3).Z_n=\log_2 y+\frac{27s^2-8n^3}{27y(s+y^3)} .

This is the original residual divided by yy, with the difference s−y3s-y^3 rationalized. The numerator 27s2−8n327s^2-8n^3 is computed in integer arithmetic. Sum ZnZ_n, Zn/nZ_n/n, and 1/n1/n from the first term through NN 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=8m=8 and m=11m=11, illustrating why finite samples alone cannot establish the distinct limits.

References

  1. [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.
  2. [2] OEIS Foundation. A002984 and A109965. The latter entry points to Exercise 3.28 and explains the extra initial term.
  3. [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.
  4. [4] Jonathan Vos Post. A113768, The On-Line Encyclopedia of Integer Sequences, 2006. Leading asymptotic conjecture contributed by José María Grau Ribas, 13 February 2024.
  5. [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.
  6. [6] OEIS Foundation. A159016, square array of the square-root chains, and 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.