33

What's the closest approximation to $\pi$ achievable using each digit $0-9$ no more than once, and basic operations of roots, brackets, exponentiation, addition subtraction, concatenation, division and factorial?

This was mentioned in another question and I thought it was fun. I can pretty quickly come up with (with a bit of help from Ramanujan):

$$\frac{7}{3}\left(1+\sqrt{\frac{6}{50}}\right)-\frac{8}{2\times4\times9!}\approx3.1415958$$

I challenge anybody to get beyond 20 decimal digits of accuracy!

Shaun
  • 44,997

10 Answers10

18

$\frac{\log (5280^{\sqrt{9}} + 3!! + 4! )}{1 \times \sqrt{67}} \approx 3.14159265358979324$, good for 18 places

If you don't like logs,
$(8\times9 +\frac{52-0!}{73})(\sqrt{-1}^{\sqrt{-4}}) \approx 3.14159266$, good for 8 places of accuracy.

$\sqrt{\sqrt{\frac{2143}{5!!+7}}} \approx 3.141592653$, good for 9 places of accuracy.

$3 \sqrt{\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{20-\frac{4\times8}{9\times5 - 7 - 1}}}}}}} \approx 3.141592652$, good for 9 places of accuracy.

For $e$, I challenge people to beat Sabey's approximation of $(1+9^{-4^{7\times6}})^{3^{2^{85}}}$, which is only accurate to 18457734525360901453873570 decimal digits.

Ed Pegg
  • 20,955
16

We will use notation $\sqrt{^{n}\;x}\quad$ for $n$ nested square roots (see tehtmi's answer): $$\sqrt{^{n}\;x} = \underbrace{\sqrt{\sqrt{\cdots \sqrt{\sqrt{x}}}}}_{n} = \sqrt[2^n]{x}.$$

Here is one example:

this formula is pandigital one; it uses all mentioned operations excluding exponentiation. $$ \sqrt{\dfrac{8}{\sqrt{^2\;9}}} + \sqrt{\vphantom{\dfrac{8}{8}}^{8}\; \dfrac{\sqrt{^9\; \sqrt{6!} + \sqrt{^{11}\; \left( \sqrt{^8\;4} + \dfrac{1}{\sqrt{^{16}\;2}} + \sqrt{^9 \left(\sqrt{^7\;5!} - \sqrt{^{16}(3!-0!)}\right) } \right) }}}{7} } \\ \approx 3.14159\;26535\;89793\;23846\;26\color{Tan}{610} \approx \pi + 1.766\times 10^{-23}; \tag{P.1}$$

By steps:


$a = \sqrt{^7 \; 5!} - \sqrt{^{16}\;(3!-0!)} \approx 0.03808 59887 98727 14645 $;


$b = \sqrt{^8 \; 4} + \dfrac{1}{\sqrt{^{16}\;2}} + \sqrt{^9\; a} \approx 2.99905 70159 26621 87896$;


$c = \sqrt{6!} + \sqrt{^{11}\;b}\approx 27.83335 21520 97348 95023$;


$d = \dfrac{\sqrt{^9\;c}}{7}\approx 0.14378 82430 20488 46604$;


$\pi \approx \sqrt{\dfrac{8}{\sqrt{^2\;9}}} + \sqrt{^8\; d}$.

Simplified WolframAlpha checking code:

sqrt(8/sqrt(3)) + ( ( sqrt(6!) + (4^(1/256) + 2^(-1/65536) + ( (5!)^(1/128) - 5^(1/65536) )^(1/512) )^(1/2048) )^(1/512) /7 )^(1/256) - pi


How it can be obtained:

Note that when we will use one digit, we can approximate number $\pi$ to $2$ decimal digits: $$ \sqrt{^{15} \; (7!)!} \approx 3.1\color{Tan}{822} \approx \pi + 4.067 \times 10^{-2}; \tag{1} $$

$2$ used digits: $4$ decimal digits of accuracy: $$ \sqrt{\sqrt{5!} - \sqrt{^7\;7!}} \approx 3.141\color{Tan}{349} \approx \pi - 2.435\times 10^{-4}; \tag{2} $$

$3$ used digits: $7$ (and maybe more) decimal digits of accuracy: $$ 2 + \sqrt{\vphantom{\dfrac{1}{1}}^{\:6} \; \dfrac{7!}{\sqrt{^8 \; 9!}}} \approx 3.14159\;2\color{Tan}{576} \approx \pi -7.676 \times 10^{-8}; \tag{3} $$

$4$ used digits: $11$ (and maybe more) decimal digits of accuracy: $$\sqrt{^{5} \; \sqrt{^8\;8!} - \sqrt{^{14}\;7!}} + \sqrt{6 - \sqrt{^{16}\; 3!}} \\ \approx 3.14159\;26535\color{Tan}{682} \approx \pi - 2.157 \times 10^{-11}; \tag{4} $$

$5$ used digits: $13$ (and maybe more) decimal digits of accuracy: $$ \sqrt{\dfrac{8}{\sqrt{^2\;9}}} + \sqrt{\vphantom{\dfrac{8}{8}}^{8}\; \dfrac{\sqrt{^9\; \sqrt{6!} + \sqrt{^{11}\;3}}}{7} } \\ \approx 3.14159\;26535\;89\color{Tan}{835} \approx \pi + 4.178\times 10^{-14}; \tag{5} $$

Now, replacing the digit "$3$" in $(5)$ by appropriate expression constructed of digits $0,1,2,3,4,5$, we get $(P.1)$ which approximates number $\pi$ with accuracy of $>20$ decimal places.


Approximation without $!$ and $\sqrt{\phantom{88}}$ : $$\Large 3 + \dfrac {9^{^{\frac{2}{5\cdot 7} - \left(1+6\right)^{-4}}}} {8} = 3+ \dfrac{9^{\frac{2}{35}-\frac{1}{2401}}}{8} \\ \approx \normalsize 3.1415926535 \color{Tan}{916} \approx \pi +1.875\times 10^{-12}.\tag{P.2}$$

(see Pi Estimation using Integers for more info).

Another approximation (without multiple square roots):

$$ \left(\sqrt{3!}-\sqrt{\sqrt{90-2}-6}\right) \times \sqrt{1+(4+5)\sqrt{8}} + 0\times 7 \\ = \left(\sqrt{6}-\sqrt{\sqrt{88}-6}\right) \times \sqrt{1+9\sqrt{8}} \\ \approx 3.1415926535897\color{Tan}{423} \approx \pi - 5.089\times 10^{-14}.\tag{P.3} $$ (see The Contest Center - Pi for similar examples).

Some approximations can be derived from Pi Approximations.

Oleg567
  • 17,295
  • Good work! I know of no result longer than 20 digits yet. I hoped the roots and factorial could make this possible. – it's a hire car baby Jan 05 '18 at 15:19
  • @Robert Frost: huh, I constructed one appropriate formula recently. – Oleg567 Jan 11 '18 at 16:33
  • 1
    Personally I count $\sqrt{^n x}$ as using $n$. Not doing that is like saying $4\times 3$ doesn't use $3$ because its equal to $4+4+4$. That the latter couldn't be used because $4$ is used more than once doesn't change my POV. – SK19 May 10 '18 at 14:39
  • 9
    @SK19: the difference is: I can easily replace expression $$\sqrt{^7 5!}$$ with $1$-digital expression $$\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{5!}}}}}}},$$ but you cannot replace expression $$4\times 3=4+4+4$$ with another $1$-digital expression with digit $4$ (using operations mentioned above). – Oleg567 May 12 '18 at 11:55
13

I can't prove this, but I think we may be able to get as close as we want by starting with $1234567890$, taking some number of factorials, and then taking square roots until we get a number less than $\pi^2$. Heuristically we get a random number in the interval $[\pi, \pi^2]$ whose logarithm is uniformly distributed so we ought to be able to get as close as we like to $\pi$ by taking enough factorials.

Dan Brumleve
  • 17,796
  • You might be right but let's see it! – it's a hire car baby Jan 04 '18 at 04:42
  • I'm not even sure how to compute it with two factorials, I think Stirling's approximation is going to lose too much precision. It may not be provable, Brocard's problem seems sort of related, if we think of it as saying that we can find factorials whose square roots are arbitrarily close to integers. – Dan Brumleve Jan 04 '18 at 04:46
  • I had a similar idea to yours with 4 repeated factorial over 3 repeated factorial which may be easier to work with. – it's a hire car baby Jan 04 '18 at 04:50
  • Yeah, we get a lot more combinations by breaking up the factorials and square roots with other operations. Factorial and square root are the only unary operations that don't use digits though so we have to use arbitrarily many of each. If we interpret factorial as $\Gamma(x-1)$ then I think we can approach $\pi$ by applying $\sqrt{x}$ until it's less than $\pi$, $\Gamma(x-1)$ until it's greater, $\sqrt{x}$ again until it's less, etc. In that case we can at least compute it to see if it works. – Dan Brumleve Jan 04 '18 at 04:58
  • I've been trying the method of increasing the number with $!$, then decreasing it with $\sqrt{\cdot}$ and one of the biggest barriers so far is that you end up with the factorials of massive numbers that are impossible to compute. So even if this is theoretically possible, it might be very difficult to actually accomplish computationally. – Jam Jan 06 '18 at 18:18
  • 8
    Unfortunately I don't think we should be allowed to use factorials of non-integers (i.e. Gamma function) because it is possible to build $\pi$ exactly: $\pi = (3/2)!(6/4)!(8/9)(7-5)(1+0)$ – Tob Ernack Jan 06 '18 at 20:21
11

My answer uses lots of nested square roots, so I'll write $n$ nested square roots on $x$ as $\sqrt{^n x}$ to avoid writing them all out. Evaluated with Wolfram Alpha.

$$\sqrt{^5 70} - \sqrt{^{15} 9!} + \sqrt{^{23} 8!} + \sqrt{^{34} 14!} + \sqrt{^{36} .5} + \sqrt{^{41} 2} - \sqrt{^{46} .6} \approx \pi + 5.477.. \times10^{-16} $$

Here's something that should be equivalent that can be plugged into Wolfram Alpha: 70^(1/2^5) - 9!^(1/2^15) + 8!^(1/2^23) + 14!^(1/2^34) + (5/10)^(1/2^36) + 2^(1/2^41) - (6/10)^(1/2^46)

Basically, the fractional part of $\sqrt{^5 70}$ is a good approximation for the fractional part of $\pi$. Then the fractional part of $\sqrt{^{15} 9!}$ is a good approximation for the remaining fractional part error. And so on, with a bit of finesse to make the integer part work out nicely. Chaining a bunch of square roots on anything will always give something that helps at least a little, since you can get numbers arbitrarily close to $1$. I did a fairly simple greedy search.

Surely it is possible to do better with this approach, but I was about to the point where double precision floating point runs into trouble representing $(1 \pm \text{error})$ anyway.

tehtmi
  • 1,063
  • Getting closer to that magical 20 decimal digits! – it's a hire car baby Jan 05 '18 at 14:13
  • @RobertFrost but the digits from 0-9 were to be used only once? –  Dec 08 '18 at 15:28
  • 1
    @AbhasKumarSinha This answer could be written out with exactly 200 square root signs, and that would be silly so I permitted it to be abbreviated like this. – it's a hire car baby Dec 08 '18 at 15:46