Open problems / 013

Multiples of square roots between consecutive integers

Let $a(n)$ be the least $k$ with some integer multiple of $\sqrt k$ inside the open interval $(n, n+1)$. Kagey asked whether the value $j$ has asymptotic density $\frac{1}{\sqrt j}\prod(1 - \frac{1}{\sqrt s})$, the product over squarefree $s < j$. It does, once the product starts at $s = 2$. The proof is Weyl equidistribution together with the linear independence of the square roots of squarefree integers.

The sequence

For a positive integer $n$, let $a(n)$ be the least $k \in \mathbb{N}$ such that $m\sqrt k \in (n, n+1)$ for some integer $m$. This is A261865, and it begins

$$2, 2, 3, 2, 2, 3, 2, 2, 2, 3, 2, 2, 3, \dots$$

Here $a(3) = 3$ because $2\sqrt3 = 3.4641\ldots$, while $2\sqrt2 < 3$ and $3\sqrt2 > 4$. The sequence first leaves $\{2,3\}$ at $a(23) = 7$, where $9\sqrt7 = 23.8118\ldots$, and then at $a(30) = 15$.

Kagey observes that the value $2$ has density $1/\sqrt2$ and asks the following.

Let $S_\alpha$ be the squarefree integers strictly less than $\alpha$. Is the asymptotic density of the value $j$, for squarefree $j$, equal to

$$\frac{1}{\sqrt j}\prod_{s \in S_j}\left(1 - \frac{1}{\sqrt s}\right)?$$

Six related questions come with it. Construct an $n$ with $a(n) > K$ for a given $K$. Find the growth of the records. Find the expected time until every small value has appeared. Say what other base sequences make the construction interesting. Then two questions about $k2^{1/m}$, one asking for the least $m$ and one for the least $k$.

The answer to the main question is yes, with one correction. The product has to start at $s = 2$. The integer $1$ is squarefree, so $1 \in S_j$, and its factor $1 - 1/\sqrt1$ is zero. Kagey's recursive form of the same conjecture in his 2021 blog post does start at $2$, so the slip is in the written product and not in the guess.

One condition on a fractional part

Everything reduces to a single inequality. Write $\{x\}$ for the fractional part.

Let $\beta > 1$ be real and $n \ge 1$ an integer. At most one integer $m$ satisfies $m\beta \in (n, n+1)$, namely $m = \lfloor n/\beta\rfloor + 1$, and it exists if and only if

$$\left\{\frac{n}{\beta}\right\} > 1 - \frac{1}{\beta}.$$

Put $x = n/\beta$. The condition $n < m\beta < n+1$ reads $x < m < x + 1/\beta$. That interval has length $1/\beta < 1$, so it contains at most one integer, and the only candidate is $\lfloor x\rfloor + 1$. The candidate lies inside exactly when $\lfloor x \rfloor + 1 < x + 1/\beta$, which is $1 - \{x\} < 1/\beta$.

Perfect squares are useless, because multiples of $\sqrt{c^2}$ are integers and $(n, n+1)$ contains none. If $k = c^2s$ with $s > 1$ squarefree, then every multiple of $\sqrt k$ is a multiple of $\sqrt s$, so $k$ never beats $s$. Hence $a(n)$ is squarefree and at least $2$, and

$$a(n) = \min\left\{s \ge 2 \text{ squarefree} : \left\{\frac{n}{\sqrt s}\right\} > 1 - \frac{1}{\sqrt s}\right\}.$$

Each $s$ contributes one window at the top of the unit interval, and that window has length $1/\sqrt s$. The value at $n$ is the first $s$ whose window contains $\{n/\sqrt s\}$.

011/√ss = 20.707s = 30.577s = 50.447s = 60.408s = 70.378{23/√7} = 0.693 > 1 − 1/√7 = 0.622, and 9√7 = 23.812
The criterion at $n = 23$. Each strip is the unit interval, and the shaded window at its right end has length $1/\sqrt s$, printed on the right. The dot is $\{23/\sqrt s\}$. It misses the window at $s = 2$, $3$, $5$ and $6$, and lands inside it at $s = 7$, so $a(23) = 7$ and the multiple is $9\sqrt 7 = 23.811\ldots$. The length of the window is the density of the set of $n$ that $s$ catches.

A crude upper bound comes from counting rather than from the criterion. Among the $2n$ consecutive integers $n^2+1, \dots, n^2+2n$ there is a multiple $qk$ of $q = \lfloor\sqrt{2n}\rfloor^2$, and then $\lfloor\sqrt{2n}\rfloor\sqrt k \in (n, n+1)$, so

$$a(n) \le \frac{n^2+2n}{\lfloor\sqrt{2n}\rfloor^2} = \frac{n}{2} + O(\sqrt n).$$

The same argument shows that the multiplier $m$ in $m\sqrt{a(n)} \in (n,n+1)$ is at least $(1+o(1))\sqrt{2n}$, so it tends to infinity. That answers a question Kagey asks in the blog post about A343205. The bound on $a(n)$ itself is far from the truth. §4 suggests $a(n) = O((\ln n)^2)$.

The densities

Two facts make the windows independent of each other.

Let $s_1, \dots, s_r$ be distinct squarefree integers greater than $1$. Then $1, \sqrt{s_1}, \dots, \sqrt{s_r}$ are linearly independent over $\mathbb{Q}$, and so are $1, 1/\sqrt{s_1}, \dots, 1/\sqrt{s_r}$.

This is classical, and Besicovitch proved a more general statement for arbitrary fractional powers. The paper includes the short field-theoretic proof for square roots, by induction on the primes involved.

Let $\beta_1, \dots, \beta_r > 1$ be real numbers such that $1, 1/\beta_1, \dots, 1/\beta_r$ are linearly independent over $\mathbb{Q}$, and let $E(\beta_i)$ be the set of $n \ge 1$ for which some integer multiple of $\beta_i$ lies in $(n, n+1)$. Then for every $\varepsilon \in \{0,1\}^r$,

$$\operatorname{dens}\{n : [\,n \in E(\beta_i)\,] = \varepsilon_i \text{ for all } i\} = \prod_{i=1}^r \left(\frac{1}{\beta_i}\right)^{\varepsilon_i}\left(1 - \frac{1}{\beta_i}\right)^{1-\varepsilon_i}.$$

The events $E(\beta_i)$ have densities $1/\beta_i$, and they are independent.

The proof is Weyl's criterion. Independence over $\mathbb{Q}$ makes $\langle h, \theta\rangle$ irrational for every nonzero integer vector $h$, where $\theta = (1/\beta_1, \dots, 1/\beta_r)$, so the exponential sums are bounded and $(n\theta)_{n \ge 1}$ is uniformly distributed modulo $1$ in $\mathbb{R}^r$. The set in the statement is the set of $n$ whose point lands in a box of side lengths $1/\beta_i$ and $1 - 1/\beta_i$.

Now put

$$d_j = \frac{1}{\sqrt j}\prod_{\substack{1 < s < j\\ s \text{ squarefree}}}\left(1 - \frac{1}{\sqrt s}\right), \qquad P_K = \prod_{\substack{1 < s \le K\\ s \text{ squarefree}}}\left(1 - \frac{1}{\sqrt s}\right).$$

If $j = 1$ or $j$ is not squarefree, then $a(n) \ne j$ for every $n$. If $j \ge 2$ is squarefree, then $\operatorname{dens}\{n : a(n) = j\} = d_j > 0$, so $j$ occurs infinitely often. For every $K \ge 1$, $\operatorname{dens}\{n : a(n) > K\} = P_K > 0$. Finally $\sum_{j \le K} d_j = 1 - P_K$ and $\sum_j d_j = 1$.

The last part is Kagey's recursion $d_j = (1 - \sum_{i<j} d_i)/\sqrt j$. It telescopes, since $d_j = P_{j^-} - P_j$ with $j^-$ the largest squarefree integer below $j$. And $P_K \to 0$ because the sum of $s^{-1/2}$ over squarefree $s \le K$ diverges, already over the primes alone.

$j$$d_j$count, $n \le 10^7$freq. $-\, d_j$
20.70710687071068$+1.9 \times 10^{-8}$
30.16910201691003$-1.7 \times 10^{-6}$
50.0553611553652$+4.1 \times 10^{-6}$
60.0279365279380$+1.5 \times 10^{-6}$
70.0153052153016$-3.6 \times 10^{-6}$
100.007965379568$-8.5 \times 10^{-6}$
110.005193051970$+4.0 \times 10^{-6}$
130.003336633401$+3.5 \times 10^{-6}$
01020304050600-1-2-3-4-5jlog10 of the densityd_j, the density of the value jits frequency for n up to 10^7P_K, the density of a(n) > K
Densities against data, on a logarithmic scale, with the two series named in the key. The first is $d_j$ for squarefree $j$ up to $59$, and the dots on it are the observed frequencies among the first $10^7$ terms. Over the eight values in the table above the largest difference in density is $8.5 \times 10^{-6}$, far below the width of a dot. The dots leave the curve only at the far right, where the counts are in the dozens. The second is the tail density $P_K$, which decays like $\exp(-\tfrac{12}{\pi^2}\sqrt K)$ and not geometrically. It runs below $d_j$ at $j = 2$ and $3$ and above it from $j = 5$ on.

There is also a description by Beatty sequences. For irrational $\beta > 1$ the criterion says $E(\beta) = \{\lfloor m\beta\rfloor : m \ge 1\}$, and by Beatty's theorem the complement is $\{\lfloor m\beta'\rfloor\}$ with $1/\beta + 1/\beta' = 1$. For $\beta = \sqrt s$ that gives $\beta' = (s + \sqrt s)/(s-1)$, so

$$\{n : a(n) > K\} = \bigcap_{\substack{1 < s \le K\\ s \text{ squarefree}}}\left\{\left\lfloor m\,\frac{s+\sqrt s}{s-1}\right\rfloor : m \ge 1\right\}.$$

The case $K = 2$ is Israel's remark on the OEIS entry that $a(n) > 2$ exactly on A001952. The theorem says this intersection of Beatty sequences has the density it would have if they were independent.

The records

Let $F(K) = \min\{n : a(n) > K\}$. Half of the growth question is proved. The number of squarefree integers up to $x$ is $6x/\pi^2 + O(\sqrt x)$, so partial summation gives

$$\ln\frac{1}{P_K} = \frac{12}{\pi^2}\sqrt K + O(\ln K).$$

The other half is not proved. Treat the events $a(n) > K$, for $n = 1, 2, \dots$, as independent trials of probability $P_K$. Then $F(K)P_K$ is approximately exponential with mean $1$, so $\ln F(K) \approx \ln(1/P_K)$. That is a heuristic and nothing more. Combined with the estimate above it predicts that the record value among $a(1), \dots, a(n)$ is about

$$\left(\frac{\pi^2}{12}\ln n\right)^2 \approx 0.6765\,(\ln n)^2.$$

Convergence is slow. The ratio $\ln(1/P_K)/\sqrt K$ is $1.3107$ at $K = 100$ and $1.2706$ at $K = 1000$, against the limit $12/\pi^2 = 1.2159$. Any comparison with data at accessible $n$ has to use $P_K$ itself rather than the asymptotic form.

0246810121404812162024log10 nsqrt(k)the 29 records after a(1) = 2the K with P_K = 1/nslope (pi^2/12) ln 10
The $29$ known records after $a(1) = 2$, the last of them $a(1560674332481) = 505$. Plotting $\sqrt k$ against $\log_{10} n$ turns the prediction into a line. The dashed line is the asymptote, of slope $\pi^2/12$ per unit of $\ln n$. The solid curve is the same prediction before the asymptotics, the least $K$ with $P_K < 1/n$, and the records track it over eleven orders of magnitude. The gap between curve and line is the $O(\ln K)$ term, still wide at $K = 505$.

Two predictions about the records were registered before any of these products were computed. First, that $x_i = n_iP_{k_{i-1}}$ lies in $(0.01, 5)$ for each of the $26$ records with $n_i \ge 184$, where $k_{i-1}$ is the previous record, so that $n_i = F(k_{i-1})$. Second, that $\sqrt{k_i}/\ln n_i$ lies in $(0.6, 1.0)$ for the last ten.

The second held. The ten ratios lie between $0.769$ and $0.812$, against the predicted limit $\pi^2/12 = 0.8225$. The first failed at one record out of $26$, namely $x_i = 5.45$ at $k_i = 455$. The other $25$ values lie between $0.093$ and $3.20$, and the mean of all $26$ is $1.40$. Under the exponential model, one value above $5$ among $26$ has probability about $0.16$, so what failed was the window and not the model. The failure is recorded in the ledger in the repository.

Question 3 asks for the expected $n$ by which every small value has appeared. Read literally there is no such $n$, because $1 \in S_\alpha$ and $a(n)$ is never $1$. So let $M(\alpha)$ be the least $n$ such that every squarefree $j$ with $2 \le j < \alpha$ occurs among $a(1), \dots, a(n)$. It is finite, by the theorem. The sequence is deterministic, so an expectation needs a model, and the natural one is the coupon collector with independent draws of law $(d_j)$:

$$E(\alpha) = \int_0^\infty\left(1 - \prod_{j<\alpha}\left(1 - e^{-d_jt}\right)\right)dt.$$

The registered prediction was $0.2 < M(\alpha)/E(\alpha) < 5$ for the six values below. It held, and at $\alpha = 24$ it nearly did not. Since consecutive densities have ratio about $1 - 1/\sqrt j$, many values just below $\alpha$ are comparably rare, and $E(\alpha)$ runs ahead of $1/d_J$ for the largest squarefree $J < \alpha$ by a growing factor.

$\alpha$$M(\alpha)$$E(\alpha)$$M/E$$1/d_J$
86180.10.7665.3
12170252.40.67192.6
16662865.20.77608.0
209931759.30.561217.8
2410074358.10.232826.8
3085627670.81.124988.8

Other base sequences

The general theorem uses nothing about $\sqrt k$ beyond the independence, and it needs no monotonicity of the $\beta_i$. For any sequence $\beta_1, \beta_2, \dots$ of reals greater than $1$ with the independence property, the index of the first $\beta_i$ having a multiple in $(n, n+1)$ equals $j$ with density $\beta_j^{-1}\prod_{i<j}(1 - \beta_i^{-1})$. For $\sqrt k$ the independence fails in an organised way, because the non-squarefree $k$ are redundant, and dropping them restores it. For Kagey's other example, $\beta_k = \ln k$, we do not know whether the required independence holds.

For $2^{1/m}$ it does. Fix $M \ge 2$ and let $L = \operatorname{lcm}(2, \dots, M)$. Then $x^L - 2$ is irreducible by Eisenstein's criterion, and $2^{-1/m} = \tfrac12\,2^{e_m/L}$ with $e_m = L(m-1)/m$ distinct integers in $[1, L-1]$, so $1, 2^{-1/2}, \dots, 2^{-1/M}$ are independent over $\mathbb{Q}$.

Let $m^*(n)$ be the least $m \in \mathbb{N}$ with $k2^{1/m} \in (n, n+1)$ for some $k \in \mathbb{N}$, and let $k^*(n)$ be the least such $k$ over all $m$. Then $2 \le m^*(n) \le \lfloor(n+\tfrac12)\ln 2\rfloor + 1$, and for every $m \ge 2$,

$$\operatorname{dens}\{n : m^*(n) = m\} = 2^{-1/m}\prod_{i=2}^{m-1}\left(1 - 2^{-1/i}\right), \qquad \operatorname{dens}\{n : m^*(n) > m\} = \prod_{i=2}^{m}\left(1 - 2^{-1/i}\right) \le \frac{(\ln 2)^{m-1}}{m!}.$$

Moreover $k^*(n) = \lfloor n2^{-1/m^*(n)}\rfloor + 1$, so the least $k$ belongs to the least admissible $m$.

So $m^* = 2, \dots, 7$ have densities $0.70711$, $0.23247$, $0.05081$, $0.00837$, $0.00111$, $0.00012$, and larger values are very rare. That answers questions 5 and 6 in the same sense as the main question, and it is one answer to question 4. The factorial decay is the real difference from $a(n)$, whose tail $P_K$ decays only like $e^{-c\sqrt K}$.

What was checked

The verification script recomputes every number above and prints one line per check.

  • $a(n)$ for $n \le 10^7$ by two methods that share no code: a direct search over $k$ with the exact integer test $m^2k < (n+1)^2$, and a sieve that marks $\lfloor m\sqrt k\rfloor$ for each non-square $k$ in turn. A third method evaluates the fractional-part criterion in $30$-digit fixed point for $n \le 10^6$ and counts the cases that come within the rounding error of a boundary. There were none. All three agree everywhere.
  • The values match the $10{,}000$-term b-file of A261865, and the first occurrences match the $71$ entries of A262036 below $10^7$. Every value is squarefree and at least $2$, with $72$ distinct values and maximum $187$. Both inequalities of the crude bound hold.
  • The frequencies match the theorem to $8.5 \times 10^{-6}$ for $j \le 13$, and the tails $\{a(n) > K\}$ to $1.8 \times 10^{-5}$ for $K \in \{2,3,7,15,30,50\}$. The eight joint patterns of $E_2, E_3, E_5$ match the independence statement to $2.0 \times 10^{-5}$ at $n \le 10^6$, and the complement of $E_s$ is the stated Beatty sequence for $s \le 7$. The densities were computed both from the product and from Kagey's recursion in $50$-digit decimals, agreeing to $10^{-9}$ for all $j, K \le 1000$.
  • All $30$ published record pairs satisfy $a(n_i) = k_i$ in exact arithmetic. A separate vectorised search finds exactly the published records for $n \le 2 \times 10^9$, through $a(1558293414) = 299$. Two of those, $193$ and $217$, are missing from the record list in the OEIS comment. One of the two published lists prints $734197670805$ as the argument of the record $455$, where the right one is $734197670865$. The value at the misprinted argument is $2$.
  • For the $2^{1/m}$ variant, the counts of $m^*(n) = 2, \dots, 7$ for $n \le 10^6$ are $707107$, $232480$, $50782$, $8423$, $1079$, $116$, within $5.4 \times 10^{-5}$ of the theorem.

Beyond $2 \times 10^9$ the claim that no record was missed rests on Neil's computation alone.

What is open

Questions 1, 2 and 3 are not settled.

For question 1 the theorem shows that the obvious algorithm terminates. Testing $n = 1, 2, 3, \dots$ in exact integer arithmetic finds an $n$ with $a(n) > K$ for every $K$, and by the Beatty description the search may step through $\lfloor m(2+\sqrt2)\rfloor$ only. Weyl's criterion is not quantitative, so this gives no bound on the running time. A bound exists in principle. For integers $|h_i| \le H$, not all zero, the number $L = h_0 + \sum_i h_i/\sqrt{s_i}$ is nonzero, and $s_1\cdots s_r L$ is an algebraic integer whose conjugates are $O(H)$ and whose norm is a nonzero integer, so $|L| \ge cH^{-(2^t-1)}$ with $t = \pi(K)$, and the Erdős-Turán-Koksma inequality then yields an explicit $N_0(K)$. We have not carried that out, and the exponent $2^t$ makes any such bound enormous next to the observed $n \approx 1/P_K$. We also do not know a direct construction from simultaneous Diophantine approximations to the $1/\sqrt s$, which is what Kagey suggests. The condition is one-sided. Every $\{n/\sqrt s\}$ must avoid an interval at the top, and the pigeonhole principle gives $n$ with all $n/\sqrt s$ near integers without control of the side.

For questions 2 and 3 there is only the heuristic above and the agreement with data. Three concrete questions remain. Is $F(K) \le \exp(C\sqrt K)$? Is $a(n) = O((\ln n)^2)$? Is there a construction of $n$ with $a(n) > K$ faster than searching? For question 4, the smallest missing piece is whether $1$ and the numbers $1/\ln k$ are linearly independent over $\mathbb{Q}$.

The discrepancies in the table are of order $10^{-6}$ at $N = 10^7$, far below the $N^{-1/2}$ of random trials, which is what a Kronecker sequence with algebraic frequencies should give. Nothing here is proved about the rate of convergence, and the rate is what the open questions need.