7

I was reviewing basic Analysis and thought of this question:

Is the set $\{\sqrt n - \lfloor\sqrt n\rfloor : n\in \mathbb Z^+\}$ dense in $[0,1]$?

Lest we have any ambiguity with notational stuff, $\lfloor \cdot \rfloor$ denotes the integer part of a real number i.e., for $x\in\mathbb R$, $\lfloor x\rfloor := \max\{n\in\mathbb Z\mid n\leq x\}$.

The function $f:\mathbb Z^+\to[0,1]$ defined by $f(n)=\sqrt n - \lfloor\sqrt n\rfloor$ is injective when it is restricted to the prime numbers. I showed this using contradiction.

Let $p_1$ and $p_2$ be distinct prime numbers such that $f(p_1)=f(p_2)$. It would mean that $\sqrt {p_1} + \sqrt{p_2}$ is an integer. (contradiction!)

Thus, the set in our discussion has infinitely many points.

Suppose $p_0$, $p_1$, $\ldots$ is an enumeration of prime numbers. Using pigeon-hole principle, for every $n\geq 1$, there exists primes $p_i$ and $p_j$ with $0\leq i<j\leq n$ such that $$ |f(p_i)-f(p_j)|< \frac{1}{n}$$

I am not sure, how to proceed after this.

Nothing special
  • 3,690
  • 1
  • 7
  • 27

4 Answers4

7

This follows by a direct application of Fejer's theorem:

Theorem: Let $(f(n):n\in\mathbb{N})$ be a sequence of real numbers such that $\Delta f(n)=f(n+1)-f(n)$ is monotone in $n$. If $$\lim_{n\rightarrow\infty}\Delta f(n)=0,\quad\text{and}\quad \lim_{n\rightarrow\infty}n|\Delta f(n)|=\infty,$$ then the sequence $(f(n):n\in\mathbb{N})$ is uniformly distributed $\mod 1$.

This means that for any interval $(a,b]\subset (0,1)$ \begin{align} \lim_{n\rightarrow\infty}\frac{1}{n}\sum^n_{k=1}\mathbb{1}_{(a,b]}(f(n))=b-a\tag{0}\label{zero} \end{align}


Let $f(n)=\sqrt{n}$, $n\in\mathbb{N}$. Notice that

  1. $\Delta f(n)=f(n+1)-f(n)=\frac{1}{\sqrt{n+1}+\sqrt{n}}$ is monotone in $n$,
  2. $\lim_{n\rightarrow\infty}\Delta f(n)=0$ and
  3. $\lim_{n\rightarrow\infty} n|\Delta f(n)|=\lim_{n\rightarrow\infty} n\Delta f(n)=\infty$.

For a nice introduction to uniform distribution $mod 1$ and some functional results (including Fejer's theorem), see Kuipers, L. and Niederreiter, H., Uniform Distributions of Sequences, Dover Publications Inc. Chapter 1.


Some comments about Fejer's theorem:

The result stated above proofs much more than mere density of the sequence $(\sqrt{n}-\lfloor \sqrt{n}\rfloor: n\in\mathbb{N})$ but that in the limit, the points are uniformly distributed over $(0,1)$ (this what \eqref{zero} means). This phenomena is known as equidistribution and has a rich history. Perhaps the most basic result on this subject, due to Weyl, is the following (see for example e1 and e2)

Theorem (Weyl): The sequence $(x_n:n\in\mathbb{N})\subset \mathbb{R}$ is uniformly distributed $\mod 1$ (that is $(x_n-\lfloor x_n\rfloor:n\in\mathbb{N})$ satisfies \eqref{zero}) if and only iff $$\lim_{N\rightarrow\infty}\frac1N\sum^N_{n=1}e^{2\pi ikx_n}=0$$ for any integers $k\neq0$.

Many deep results in equidistribution of a sequence lead to probing that Weyl criteria holds. Fejer's result above is of this type. Here is a sketch of a proof of Fejer's. I recommend the OP takes a look at the reference I provided in above.

Using integration by parts, one can show that for all $t\in\mathbb{R}$ \begin{align} |e^{2\pi it}-1-2\pi it|\leq 2\pi^2t^2 \end{align} Form this, we obtain that \begin{align} |e^{2\pi k if(n+1)}-e^{2\pi k if(n)} -2\pi k e^{2\pi k if(n)}|\leq 2\pi^2 k^2|\Delta f(n)|^2 \end{align} As a consequence \begin{align} \big|\frac{e^{2\pi ik f(n+1)}}{\Delta f(n+1)}-\frac{e^{2\pi ik f(n)}}{\Delta f(n)} - 2\pi ik fe^{2\pi ik f(n)}\Big|\leq \Big|\frac{1}{\Delta f(n+1)}-\frac{1}{\Delta f(n)}\Big| + 2\pi^2 k^2|\Delta f(n)|\tag{1}\label{one} \end{align} Since \begin{align} \sum^N_{n=1}e^{2\pi ik f(n)}&=\frac{1}{2\pi ik}\sum^N_{n=1}\Big(2\pi ik e^{2\pi ik f(n)}-\frac{e^{2\pi ik f(n+1)}}{\Delta f(n+1)}-\frac{e^{2\pi ik f(n)}}{\Delta f(n)}\Big) +\\ &\qquad \qquad \frac{e^{2\pi i f(N+1)}}{\Delta f(N+1)} -\frac{e^{2\pi i f(1)}}{\Delta f(1)}, \end{align} \eqref{one} and the monotonicity of $\Delta f(n)$ yields \begin{align} \frac1N\Big|\sum^N_{n=1}e^{2\pi ik f(n)}\Big|&\leq \frac1{\pi |k|}\left(\frac{1}{(N+1)\Delta f(N+1)}+\frac{1}{(N+1)\Delta f(1)}\right)+\\ &\qquad\qquad \frac{\pi |k|}{N}\sum^N_{n=1}|\Delta f(n)| \end{align} The assumptions in Fejer's theorem imply that the conditions in Weyl's criteria hold.


Final remark:

Fejer's theorem can also be used to imply the u.d. $mod 1$ of the sequence $(a n^p\log^q n:n\in\mathbb{N})$ with $0<p<1$ and $\tau\in\mathbb{R}$.

Mittens
  • 46,352
  • I don't understand the notation $\mathbb{1}_{(a,b]}(f(n))$. What does it mean? I know that $x \mod 1$ means the fractional part of $x$. – Nothing special Aug 07 '24 at 17:34
  • 1
    @Nothingspecial: $\mathbb{1}A(x) =1$ if $x\in A$ and $\mathbb{1}_A(x)=0$ if $x\notin A$. $\frac{1}{n}\sum^n{k=1}\mathbb{1}_A(x_n)$ is the empirical frequency or the proportion of time up to $n$ in which the sequence $(x_n)$ is in set $A$. – Mittens Aug 07 '24 at 17:38
  • Okay I get it! Nice theorem. All of this still works if replace $\sqrt n$ by $\ln(n)$. I need to learn more of these sledge hammers. They are really useful in cracking MCQs and True/False questions asked in entrance tests. – Nothing special Aug 07 '24 at 17:44
  • 1
    @Nothingspecial Some comments under the question amount to proving Fejer's theorem in the special case involved here. The theorem generalizes that argument by making explicit the properties of the sequence $(\sqrt n)$ that are used in the proof. You might find it easier and more useful to learn the method than to learn the statement of the theorem. – Andreas Blass Aug 07 '24 at 18:11
  • @Nothingspecial: my intention was not so much to give you a hammer and treat any other problem as a nail;, but to let you know that there is a whole body of mathematics dedicated to this problem (which have many interesting applications in computer science besides mathematics). I gave you the standard and well appreciated reference in my previous comment. The must basic result in this types of problems is the Weyl equidistribution theorem. I'll try to elaborate more on Fejer's theorem in my posting when I am done with my real job today. – Mittens Aug 07 '24 at 19:26
  • 2
    This answer is major overkill. – Adam Rubinson Aug 07 '24 at 22:17
  • @AdamRubinson: If you have an easier and illuminating solution, please share it. – Mittens Aug 07 '24 at 22:29
  • My answer would be similar to Yves Daoust's answer. – Adam Rubinson Aug 07 '24 at 22:51
  • @AdamRubinson: yes, sure! Yves solution happens to be in fact very closed to the one solution posted here. – Mittens Aug 07 '24 at 22:57
  • I'm not yet prepared to understand Weyl. I'm going through the first chapter. It will take some time. I will accept your answer, only after I understand it. – Nothing special Aug 08 '24 at 14:58
  • 1
    @Nothingspecial: The idea is first to show that a sequence $(x_n:n\in\mathbb{N})$ is uniformly distributed $qmod 1$ if and only if for any Riemann integrable function $f$ in $(0,1)$, $\lim_n\frac1n\sum^n_{k=1}f(x_k)=\int^1_0f(x),dx$. This is based on taking upper and lower Riemann sums. Then in particular take $f(x)=e^{2\pi ikx}$, $k\in\mathbb{N}$. The version I stated comes from the density of trigonometric polynomials in the space of Riemann integrable functions on $[0,1]$. There are posting in MSE with proofs for this. – Mittens Aug 08 '24 at 15:04
6

Subdivide the interval $[0,1]$ in subintervals of with $\dfrac1m$, giving the bounds $\dfrac km$ with $k=0,1,\cdots m$. I claim that for every $k$, $n$ equal to $m^2+2k+1$ is such that $\sqrt n-\lfloor \sqrt n\rfloor$ belongs to the subinterval $\left[\dfrac km,\dfrac{k+1}m\right]$.

Indeed, $$\frac km\le \sqrt{m^2+2k+1}-m\le \frac{k+1}m.$$

is equivalent to

$$2k+\frac{k^2}{m^2}\le 2k+1\le 2k+2+\frac{(k+1)^2}{m^2}.$$

So for any real in $[0,1]$ you will find a subinterval as small as you want that contains that real as well as some $\sqrt n-\lfloor \sqrt n\rfloor$.


E.g. approximate $0.371$ to less than $0.001$. We take $m=1000, k=371$ and $n=1000^2+2\cdot371+1$.

$$\sqrt{1000743}-1000=0.37143\cdots$$

2

Pointing at this question, let's prove the following

Lemma. Let $(u_n)_{n\in\mathbb{N}}$ be an increasing sequence such that $$u_n \to \infty, n\to\infty\tag{1}$$ and $$u_{n+1}-u_n \to 0,n\to\infty\tag{2}$$ Then $\left\{u_n-\lfloor u_n \rfloor : n\in \mathbb Z^+ \right\}$ is dense in $[0,1]$

Let's establish one important property, from $(2)$ and the fact that $(u_n)_{n\in\mathbb{N}}$ is increasing, $\forall \varepsilon>0$ $\exists N_{\varepsilon}\in \mathbb{N}$: $$u_n<u_{n+1}<u_n +\varepsilon \tag{3}$$ for $\forall n>N_{\varepsilon}$.

We need to show that $\forall a,b$ real numbers s.t. $0 < a < b <1$ there $\exists u_n$ from the sequence s.t. $a<\{u_n\}<b$, where $\{\}$ is the fractional part.

Proof by contradiction. Assume $(u_n)_{n\in\mathbb{N}}$ is not dense in $[0,1]$, which means there $\exists a,b$ real numbers s.t. $0 < a < b <1$ s.t. for $\forall n\in\mathbb{N}$:

  • $0\le\{u_n\} \le a$ or
  • $b\le\{u_n\}$

We have 3 cases to check ...


Case 1. $0\le\{u_n\} \le a$ for $\forall n > N_{\varepsilon}$.

From $(3)$ $$u_n<u_{n+1}<u_n +\varepsilon = \left \lfloor u_n\right \rfloor +\left\{u_n\right\}+\varepsilon \le \left \lfloor u_n\right \rfloor +a+\varepsilon \Rightarrow \\ 0 < u_{n+1} - \left \lfloor u_n\right \rfloor < a+\varepsilon$$ Now $0<a<1$ and we can "adjust" $\varepsilon$ s.t. $a+\varepsilon <1$ leading to $$0 < u_{n+1} - \left \lfloor u_n\right \rfloor <1$$ Or, because the sequence is increasing $$0 \le \left \lfloor u_{n+1}\right \rfloor - \left \lfloor u_n\right \rfloor \le u_{n+1} - \left \lfloor u_n\right \rfloor <1$$ Leading to $\left \lfloor u_{n+1}\right \rfloor = \left \lfloor u_n\right \rfloor$ for $\forall n > N_{\varepsilon}$. This contradicts the $(1)$ above.


Case 2. $b\le\{u_n\}$ for $\forall n > N_{\varepsilon}$.

From $(3)$ and $b\le\{u_n\} \Rightarrow b\le\{u_{n+1}\}$ $$\left \lfloor u_{n+1}\right \rfloor +b \le \left \lfloor u_{n+1}\right \rfloor +\left\{u_{n+1}\right\}=u_{n+1} < u_n + \varepsilon$$

We can "adjust" $\varepsilon$ s.t. $b-\varepsilon >0$, leading to

$$0< b-\varepsilon < u_n - \left \lfloor u_{n+1}\right \rfloor \Rightarrow \left \lfloor u_{n+1}\right \rfloor < u_n$$

The sequence is increasing, thus $$0 \le \left \lfloor u_{n+1}\right \rfloor - \left \lfloor u_n\right \rfloor < \left\{u_n\right\} < 1$$

Leading to $\left \lfloor u_{n+1}\right \rfloor = \left \lfloor u_n\right \rfloor$ for $\forall n > N_{\varepsilon}$. This contradicts the $(1)$ above.


Case 3. $(u_n)_{n\in\mathbb{N}}$ is alternating between $0\le\{u_n\} \le a$ and $b\le\{u_n\}$ infinitely many times. If it doesn't alternate infinitely many times, then the sequence gets stuck in the case 1 or case 2 from some $n$ onwards.

As such, the sequence has a subsequence $(u_{n_{k}})_{k\in\mathbb{N}}$ s.t.

  • $0\le \{u_{n_k}\} \le a$ and
  • $b\le \{u_{n_k +1}\}$

From $(3)$ and because the sequence is increasing $$0<u_{n_{k}+1} -u_{n_k} <\varepsilon \iff \\ 0< \left \lfloor u_{n_k +1}\right \rfloor - \left \lfloor u_{n_{k}}\right \rfloor +\{u_{n_{k}+1}\}-\{u_{n_{k}}\}< \varepsilon$$ or $$0<b-a \le \{u_{n_k +1}\} - \{u_{n_k}\} \le \left \lfloor u_{n_k +1}\right \rfloor - \left \lfloor u_{n_{k}}\right \rfloor +\{u_{n_{k}+1}\}-\{u_{n_{k}}\}< \varepsilon$$ or $$0<b-a < \varepsilon$$ This contradicts the fact that $\varepsilon$ can be "adjusted" to be arbitrarily small. Technically, it contradicts $(2)$ above.

This concludes the proof.


Now, let's apply the lemma to the $u_n=\sqrt{n}$

  • $(\sqrt{n})_{n\in\mathbb{N}}$ is increasing
  • $\sqrt{n} \to\infty, n\to\infty$
  • $\sqrt{n+1}-\sqrt{n}=\frac{1}{\sqrt{n+1}+\sqrt{n}} \to 0, n\to\infty$

As a result, $\left\{\sqrt{n}-\lfloor \sqrt{n} \rfloor : n\in \mathbb Z^+ \right\}$ is dense in $[0,1]$.

rtybase
  • 17,398
  • 1
    Using $a<b\Rightarrow \lfloor a\rfloor \leq \lfloor b\rfloor$, I'd write case 1 in this way: Let $0<\varepsilon<1-a$. $\exists$ $N\in\mathbb N$ s.t. ${u_n}\in [0,a]$ and $0<u_{n+1}-u_n<\varepsilon$ for all $n\geq N$. Thus, for all $n\geq N$: $\begin{align}0&\leq \lfloor u_{n+1} \rfloor -\lfloor u_n\rfloor \ &= \underbrace{u_{n+1}-u_n}{\leq, \varepsilon} -\underbrace{{u{n+1}}}{\geq, 0}+\underbrace{{u_n}}{\leq, a}\&\leq \varepsilon+a\&< 1\end{align}\ \implies \lfloor u_{n+1}\rfloor =\lfloor u_{n}\rfloor \ \text{(contradiction since $u_n\to\infty$.)}\tag*{}$ – Nothing special Oct 11 '24 at 18:05
  • 1
    And case 2 is isomorphic to case 1 :) Let $0<\varepsilon<b$. $\exists$ $N\in\mathbb N$ s.t. ${u_n}\in [b,1]$ and $0<u_{n+1}-u_n<\varepsilon$ for all $n\geq N$. Using these, we have for all $n\geq N$: $\begin{align}0&\leq \lfloor u_{n+1} \rfloor -\lfloor u_n\rfloor \ &= \underbrace{u_{n+1}-u_n}{\leq, \varepsilon} -\underbrace{{u{n+1}}}{\geq, b}+\underbrace{{u_n}}{\leq, 1}\&\leq \varepsilon-b+1\&< 1\end{align}\ \implies \lfloor u_{n+1}\rfloor =\lfloor u_{n}\rfloor \ \text{(contradiction since $u_n\to\infty$.)}\tag*{}$ – Nothing special Oct 11 '24 at 18:13
  • 1
    One more thing: this lemma can also be used on $u_n=\log n$, $u_n =1+ \frac12+\ldots+\frac1n$. – Nothing special Oct 11 '24 at 18:18
1

Let $r$ any real in $[0,1]$ and $\epsilon>0$, the allowed approximation error. WLOG $\epsilon=\dfrac1m$ with $m$ integer.

We set $k=[mr]$ (rounding to the nearest integer). Now consider $n=m^2+2k$. We have $m^2\le n<(m+1)^2$ so that $\lfloor\sqrt n\rfloor=m$. Then

$$\begin{align}|\sqrt n-\lfloor\sqrt n\rfloor-r|&=\left|m\sqrt{1+2\frac k{m^2}}-m-r\right|\\&=\left|\frac km-\frac{k^2}{4m^3}+\frac{k^3}{8m^5}-\cdots-r\right|\\&<\frac1m=\epsilon\end{align}$$ using a Taylor development.

The final inequality is justified by the fact that the rounding error does not exceed $\dfrac12$, and the other terms contribute little: $\dfrac{k^2}{4m^3}<\dfrac\epsilon4, \dfrac{k^3}{8m^5}<\dfrac{\epsilon^2}8,\cdots$