TITLE: Decimals of the square root of $n$.
QUESTION [8 upvotes]: Let $a_1, \ldots, a_k$ be any sequence of digits (i.e., each $a_i$ is between 0 and 9). Prove that there exists an integer $n$ such that $\sqrt{n}$ has its first $k$ decimals after the decimal point precisely the string $a_1\ldots a_k$. A possible solution of this problem (but by no means the only solution!) uses the fact that
$$\sqrt{n+1} - \sqrt{n} < \frac1{2\sqrt{n}}\,\,\,\text{ for all }n\geq 1$$
Can anybody please help me to approach the solution?
I am not getting what the inequality has to do with decimals of root $n$.

REPLY [8 votes]: The hint is misleading: it shouldn't use the same symbol $n$. So let's use the hint
$$\sqrt{i+1}-\sqrt i < \frac{1}{2\sqrt i} \text{ for all }i \ge 1$$
Choose $i$ large enough so that $\dfrac{1}{2\sqrt i} < 10^{-k}$. Then successive square roots $\sqrt i, \sqrt{i+1},\sqrt{i+2},\ldots$ differ by less than $10^{-k}$. Now choose $j$ large enough so that $\sqrt{i+j} > \sqrt i + 1$. Then the square roots from $\sqrt i$ to $\sqrt{i+j}$ will contain all possible sequences of $k$ digits after the decimal point. So one of them must equal $a_1\ldots a_k$.

REPLY [3 votes]: To use the relation you are given, $\sqrt{n+1}-\sqrt n \lt \frac 1{2\sqrt n}$, note that the positional value of $a_k$ is 10^{-k}.  If $\frac 1{2\sqrt n} \lt 10^{-k}$ , which means $n \gt 10^{2k}/4$ the step between square roots will be less than $10^{-k}$ so you will hit every string of $k$ decimals.   You can then take any $n\gt 10^{2k}/4$ and $m=\lfloor \sqrt{n+0.a_1a_2a_3\dots (a_k+1)}\rfloor$ is the integer you seek.