# Why is $\frac{\sqrt{6}}{32}(29 + \sqrt{145}) \approx \pi$ ?

Apologies in advance if this is a stupid question; also, disclaimer: this is purely for fun; but:

Why is $\frac{\sqrt{6}}{32}(29 + \sqrt{145})$ such a good approximation to $\pi$?

(Correct to 8 decimal places if my calculator is to be believed).

Is it just a numerical coincidence, or is there actually some deep explanation (like the famous almost-integer $e^{\pi\sqrt{163}}$ related to Heegner numbers)?

[Not my observation, though; this is taken directly from a comment by the user "unknown (yahoo)" in the closed question

https://mathoverflow.net/questions/67161

...who noticed that $\frac{9}{8\pi} + \frac{8\pi}{29} \approx \sqrt{3/2}$, which is equivalent to the approximate equation above; although he/she didn't give any further explanation].

My knowledge of number theory is extremely limited, but it looks like standard methods like continued fractions etc. won't work here - or will they?

* EDIT: after some more numerical searches: *

$(\sqrt{a} + \sqrt{b})/c$ with integer $a,b,c$ can approximate a bit better for certain $c$ than for others; e.g. for $c=32$ as above, the error of the best approximation is (very) roughly $1/100$ of the error for $c= 23,26,29,30$ and $1/10$ of the error for $27,28,33,34$, etc.

But all values of $c$ seem to be not too bad; the worst values have errors still within a factor of roughly $100$ of the best values. Results with $e$ and random numbers instead of $\pi$ seem vaguely similar.

So, this approximation is maybe not as striking as I first thought; but anyway, maybe there is still something deeper lurking behind it. Maybe, also, it's nothing to do with $\pi$.

• speaking of fun, you might enjoy mathworld.wolfram.com/PiApproximations.html – Suvrit Jun 8 '11 at 9:26
• Adding up the number of decimal digits of all the numbers that occur in the left hand side, one checks that the left hand side has 8 digits. So it's not surprising that you can adjust them so as to get a match that is correct to 8 decimal places. – André Henriques Jun 8 '11 at 9:29
• That's a good remark. Yet there could be an explanation about why that choice of numbers is better. The fraction $355/113$ also gives $6$ correct decimals of $\pi$, but we do have a better explanation than "some fraction of positive integers less than $1000$ should work". – Pietro Majer Jun 8 '11 at 11:39
• I think André's comment explains "why". There are plenty of other formulae of this sort, like $(16+11\sqrt{14}+19\sqrt{13})/40$. – Chris Wuthrich Jun 8 '11 at 12:59
• Do we have an explanation for why 355/113 is so good? The continued fraction quotient is large (292). :-P – Junkie Jun 8 '11 at 21:56

This is not a a well posed question because the rules of what expressions are allowed have not been specified. If, for example, the domain is expressions of the form $\frac{\sqrt{a}+\sqrt{b}}{c}$ with $a,b,c$ non-negative integers then one could call an expression a best approximation (to $\pi \approx 3.1415926536$) if it has smaller error than any $\frac{\sqrt{a'}+\sqrt{b'}}{c'}$ with $c' \le c.$ Then one could ask how to find the best approximations, is your expression one of these and , if so, is it a better approximation than one might expect for a bound $c \le n?$ For rational numbers $\frac{p}{q}$ it is known how to find the best (rational) approximations and that one can expect from them that the approximation will have error roughly $\frac{1}{q^2}.$ A particular best rational approximation mentioned by Pietro is $\frac{355}{113}.$ See my comment for why it could be considered surprisingly good. I previously guessed that for your problem (as I have framed it) one might expect $\frac{1}{q^6}$ error but now I think that is wrong. See below. By this measure, the expression given ,$$\frac{29\sqrt{6}+\sqrt{870}}{32}=\frac{\sqrt{5046}+\sqrt{870}}{32}\approx 3.1415926546$$ is fairly good but $$\frac{3\sqrt{41}+\sqrt{149}}{10}=\frac{\sqrt{123}+\sqrt{149}}{10} \approx 3.1415928328$$ is better (relative to the denominator) as are $\frac{10+\sqrt{229}}{8}$ and $\frac{1+\sqrt{71}}{3}.$ None of these impress me as much as $355/133$ though.

later thoughts This is fun as a puzzle but not much more. $\pi$ is an exceptional number and has particular approximation expressions, but these are not among them. Best rational approximation and continued fractions are quite special. The approximations are easy to find, can actually be useful, and certain accuracy can be certain. They have even been suggested as a possible alternative to floating point for use in computer computations with reals. The arithmetic and geometry are beautiful and the mathematical connections are deep. It is not a coincidence that the first few approximations to $\pi$ are $\frac31,\frac{22}{7}=\frac{1+7\cdot 3}{0+7\cdot 1},\frac{333}{106}=\frac{3+22\cdot 15}{1+7\cdot 15}$ and $\frac{355}{113}=\frac{22+333}{7+106}$. The accuracy of an approximation depends only on the fractional part (so it as easy or hard to get $\pi$ with a denominator under $n$ as to get $100+\pi$ ). None of these things seem to be true for $\frac{\sqrt{a}+\sqrt{b}}{c}$ nor for roots of degree 4 polynomials.

That said, I now think that to approximate a positive target real $T$ with denominator exactly $c$ one can expect an error of order $\frac{1}{c^4T^3}$ This because the number of expressions $\sqrt{a}+\sqrt{b}$ in an interval $(x-1/2,x+1/2)$ is almost exactly $\frac{x^3}{3}$ so we would expect to be able to approximate $cT$ by $\sqrt{a}+\sqrt{b}$ with error of order $\frac{1}{c^3T^3}$ and hence $T$ by $\frac{ \sqrt{a}+\sqrt{b}}{c}$ with accuracy as given. So I propose defining the virtue of an approximation $\frac{ \sqrt{a}+\sqrt{b}}{c}$ to $T=\pi$ to be $-log_{c\pi}|\pi-\frac{ \sqrt{a}+\sqrt{b}}{c}|$ and expect it to be about $3$. I can report that for $3 \le c \le 200$ the $198$ virtue values of the best approximations (one for each $c$) are best fitted by the line $3.0339-0.000014c$ so that certainly seems satisfyingly flat. I find (in accordance with more extensive reports by others here) that the approximations which beat any previous one (with regard to absolute error) are for these triples $[c,a,b]=$ $\small [3, 1, 71], [4, 38, 41], [5, 45, 81], [6, 2, 304], [6, 5, 276], [7, 18, 315], [8, 100, 229], [10, 149, 369], [14, 181, 932]$

$\small [21, 469, 1964], [24, 120, 4153], [27, 937, 2939], [28, 1724, 2157], [31, 576, 5386], [32, 870, 5046], [59, 2027, 19693]$

$\small [69, 930, 34698] [80, 697, 50592], [91, 9774, 34977], [98, 2377, 67144], [120, 2010, 110329]$

$\small [132, 1311, 143249], [142, 14503, 106066], [152, 36835, 81566], [181, 67364, 95532]$

For these 24 best approximations the virtues get up to 3.83837,3.80356,3.734 at c=10,8,32 respectively. However these are relatively early so it is hard to say what to expect.

• Sorry to be so stupid; where does your $1/q^6$ come from? From $(1/q^2)^3$, or something deeper? – Zen Harper Jun 9 '11 at 2:26
• In the meaningless coincidence department it is amusing to note that $\frac{1+\sqrt{71}}{3}-\pi\approx\frac{1}{2186.8879}$ and $3^7=2187.$ If the virtue rating is $-log_c(|\pi-\frac{\sqrt{a}+\sqrt{b}}{\sqrt c}|),$ then this approximation with a virtue rating of $6.99995$ is the most virtuous that I ran into in a quick search. – Aaron Meyerowitz Jun 9 '11 at 2:26
• It was just a guess but seemed to work. My extremely crude reasoning was: for rational numbers $p/q$ you can get accuracy of $1/2q$ with denominator $q$ and the square of that, $1/q^2$ with denominator $\le q$. If we used $\sqrt{a}/q$ then the accuracy for fixed $q$ should be more like order $1/q^2$. Maybe the accuracy is squared to $1/q^4$ for denominator $\le q$ and gets another factor of $1/q^2$ using two square roots on top. I can now say that, for $c<70$, $1/q^5$ seems common and $1/q^7$ rare. But the reasoning for rationals does not carry over well so I could be way off for "big" $c$. – Aaron Meyerowitz Jun 9 '11 at 3:49
• Perhaps a more uniform domain would be to approximate $\pi$ by algebraic numbers of degree $\leq 4$ in terms of their height. This would then be related to the Wirsing conjecture, see eg works of Yann Bugeaud. – dke Jun 9 '11 at 11:21
• I searched for best approximations up to about c<420; the values 32, 69, 98, 132, 181, 210, 301, 373 for c are better than nearby values. A linear regression of log(error) on log(c) gave the best fit line log(error) = -4.23417 log(c) -5.7329, with correlation coefficient -0.986. Doubtless, someone more skilled with computers with fancy graphical software could do a much better analysis; this seems to suggest an exponent of around 4 rather than 6. – Zen Harper Jun 10 '11 at 8:18

There are marvelous approximations to $\pi$ based on modular functions related to the Hilbert Class 1 Heegner numbers and Class 2 numbers like 58. The numbers 29 = 58/2 and 145 = 5*29 are interesting in your approximation. For example:

$$e^{\pi \sqrt{58}} \approx \frac{(5+\sqrt{29})^{12}}{64} + 24$$

But I don't think your question corresponds to these modular approximations You can find articles describing the modular function approximations at http://sites.google.com/site/tpiezas/ramanujan.