4

Suppose I want to find integers such that when I multiply it by an irrational number (e.g $\sqrt{2}$), its decimal part contains 0.14159... as starting digits. How do I find them? Is there a pattern for the digits of such numbers?

4 Answers4

3

It is fairly easy to compute $\sqrt{2}$ to arbitrarily high precision. See for example this page reporting a little more than one million digits.

If we are searching for a fixed initial string of length $n$, then of course if it can be located in $\sqrt{2}$ further along, that string can be brought to the front by multiplying by the appropriate power of ten. One then has a (not necessarily minimum) solution for $a$. In this case the string "14159" is found seven times within the first million digits.

Finding the minimum value of $a$ seems to be a difficult computational challenge.

hardmath
  • 37,715
  • So you mean that every given string of digits is contained in $\sqrt{2}$ ? Do other irrational numbers of the form $\sqrt{b}$ where b is integer have this property ? – Tung Nguyen Feb 25 '17 at 15:37
  • 1
    @TungNguyen It is not known. "Almost all" numbers have this property, yet it hasn't been proven for any particular number except those constructed specifically for this purpose. – Ivan Neretin Feb 25 '17 at 15:39
  • Thanks, your trick solved my question for the $\sqrt{2}$ case. I would upvote it. But I'm looking for solutions that can be extended to other irrational numbers of the form $\sqrt{b}$, and is within a given range ( abs(a) can't be too large). I'm thinking along the line of significant digits and such. The latter digits of $\sqrt{2}$ don't contribute much to the product, thus we don't need full precision of $\sqrt{2}$ anyway. – Tung Nguyen Feb 25 '17 at 15:48
  • It generalizes to other numbers of the form $\sqrt{b}$ in that the Newton iteration (doubling precision with each step) makes it cheap to compute a large number of decimal places. You gave no info about how the magnitude of $a$ should be limited, so I'm not sure I can address that concern. – hardmath Feb 25 '17 at 16:03
  • I want the magnitude of a to be within 10^13. The product should have as many decimal digits of pi as possible. Searching every possible value of $a$ for a given string is too expensive. – Tung Nguyen Feb 25 '17 at 16:06
3

The equidistribution theorem says that if $\alpha$ is an irrational number, then the sequence of fractional parts, $k\alpha-\lfloor k\alpha\rfloor$, for $k\in\mathbb{N}$, is equidistributed in $[0,1]$. In particular, the interval $(0.14159,0.14160)$ will, in the limit, be visited on average once every $100{,}000$ multiples. More generally, any opening string of $n$ digits will occur on average once every $10^n$ multiples.

Barry Cipra
  • 81,321
  • 1
    In my understanding, your theorem asserts the existence of such k for a given n digits fractional part for every 10^n integers. For large strings, (13 digits for examples), I have to search for k from 1 to 10^13. It's not quite efficient. – Tung Nguyen Feb 25 '17 at 16:31
3

I suggest the following approach. Suppose we have an irrational number $\alpha$ and want to have some $n\in\mathbb N$ such that the fractional part of $n\alpha$ equals some goal $x$ with certain precision.

  1. Start with $n=0$.
  2. Take $q$, the denominator of the first convergent of $\alpha$. Find the step size: number from $(-0.5,0.5]$ equivalent modulo 1 to the fractional part $\{q\alpha\}$.
  3. Add step to $n\alpha$ (that is, add $q$ to $n$) as many times as it takes to get $\{n\alpha\}$ as close to the goal as possible, without wrapping around 1. For example, if step size is 0.13 and the goal is 0.69, then add 5 times. It may turn out (like it does with $\alpha=\sqrt2$ and $x=0.14159$) that making even one step takes us farther away from the goal than we were; then don't make it at all, i.e., make 0 steps.
  4. Take the next convergent and repeat.
  5. Move on to the next convergent, and continue in this manner until we reach $x$ with desired precision.

This method is guaranteed to work on any irrational $\alpha$ and is not hinged on the hypothesis of its normality. Also, it is pretty fast. Denominators always grow exponentially or faster, so you'll need at most $O(n)$ convergents to achieve the precision of $n$ digits. As for finding the minimum possible solution, I don't think it guarantees that (why would it?), but I expect it to fall reasonably close - that is, less than an order of magnitude away.

Upd. I've ran some tests and behold, it does find the minimum solution more often than not.

$$\begin{array}{lll} \text{Goal} & n\text{(my method)} & n\text{(min.)} \\ 0.14159 & 176827 & 96045 \\ 0.71828 & 59937 & 59937 \\ 0.73205 & 28067 & 28067 \\ 0.61803 & 2126 & 2126 \\ 0.33333 & 76162 & 76162 \\ \end{array}$$

Now what about complexity?

$$\begin{array}{lll} \text{Goal} & n & \text{Convergents used} \\ 0.1415 & 9522 & 12 \\ 0.14159 & 176827 & 15 \\ 0.141592 & 1118491 & 17 \\ 0.1415926 & 8880289 & 19 \\ \end{array}$$

Ivan Neretin
  • 13,429
-2

We can show that there exists no integer such that $a \cdot \sqrt{2}$ has the full decimal part of $\pi$. Suppose there were such an integer $a$ such that $a \cdot \sqrt{2} = B + \pi -3$, where $B \in \mathbb{Z}$. Then, we would also have that $a \cdot \sqrt{2} + 3 -B = \pi$. But then notice that the LHS is an algebraic number, whereas the RHS is a transcendental number. Contradiction.

Harry
  • 160