2

I'm very much aware of the
$$\pi = 4 \left(1 - \frac13 + \frac15 - \frac17 + \frac19 -\cdots \right)$$ and
$$\pi = \sqrt{6\left(1 + \frac14 + \frac19 + \frac{1}{16}+ \cdots \right)}$$ and even less common $$\frac\pi2 = \frac21 \cdot \frac23 \cdot \frac43 \cdot \frac45 \cdot \frac65 \cdot \frac67 \cdot \frac87 \cdot \cdots$$

What I'm wondering is if there is a RECURSIVE (not summative) way to find $\pi$.

An example for phi ($\phi$) is: $$f(1) = 1; \quad f(n) = 1+\frac1{f(n-1)}$$

By recursive function, I mean a function that calculates its next value based on the current or previous (or even further back) value.

Yuriy S
  • 31,474
  • 2
    For the question to make sense, you should ask for a recurrence of the form $\pi_{n+1}=\phi(\pi_n)$ where $n$ does not appear explicitly. –  Apr 15 '18 at 19:05
  • Use Newton's Method $x_{n+1}=x_n-d_n,$ where $d_n=\frac {f(x_n)}{f'(x_n)}$, with $x_1=1/2$ and $f(x)=-1/2+\sin x.$ Compute the $\sin$ and $\cos$ of $x_{n+1}$ from the $\sin$ and $\cos$ of $x_n$ and from the $\sin$ and $\cos$ of $d_n,$ using the angle-sum trig formulas. Use the power series for $\sin$ to compute $\sin x_1$ and each $\sin d_n$ ......... Now $ x_n$ converges rapidly to $\pi /6$. – DanielWainfleet Apr 15 '18 at 21:44
  • Calling Wallis product "less common" is curious, because it was the second infinite sequence converging to $\pi$ ever found (as far as I remember, the first was Viete product) – Yuriy S Apr 16 '18 at 06:48
  • Look at the continued fractions in this Wikipedia article, seeing as the example for $\phi$ you provide is a continued fraction https://en.wikipedia.org/wiki/Generalized_continued_fraction#%CF%80 – Yuriy S Apr 16 '18 at 06:54
  • @YuriyS: if explicit $n$ is allowed, the question is trivial as all formulas for $\pi$ can be expressed as recurrences. –  Apr 16 '18 at 07:04
  • @YvesDaoust, you are right! I haven't caught that part. The generalized CF for $\pi$ indeed use $n$ explicitly. Thank you – Yuriy S Apr 16 '18 at 07:06

7 Answers7

3

There is no rational recurrence of the form

$$\pi_{n+1}=\frac{P(\pi_n)}{Q(\pi_n)}$$ where $P,Q$ are polynomials with algebraic coefficients, because that would mean that $\pi$ is itself algebraic (it would be solution of $x Q(x)-P(x)=0$).

If transcendental functions are allowed, you can use the interesting

$$\pi_{n+1}=\pi_n+\sin\pi_n$$

but it is simpler to directly use $\pi_n=4\arctan 1$.

(This essentially means that there is no suitable recurrence.)

  • 1
    @RobArthan: if you allow explicit use of $n$, the question loses any interest, as all infinite sums and products are covered. Even worse if transcend functions are allowed. –  Apr 16 '18 at 06:39
  • That seems to be what the OP was asking, so +1. Though we can't be sure unless they clarify the question – Yuriy S Apr 16 '18 at 07:12
  • The OP has made it clear that it is this very restricted notion of recursive definition that is of interest. – Rob Arthan Apr 16 '18 at 09:25
3

If you allow more complicated sequences (so called "iterated means"), there are several that give $\pi$ in various forms and do not explicitly contain $n$ in their definition.

For example:

$$a_{n+1}=\frac{\sqrt{(a_n+b_n)(a_n+c_n)}}{2} \\ b_{n+1}=\frac{\sqrt{(b_n+a_n)(b_n+c_n)}}{2} \\ c_{n+1}=\frac{\sqrt{(c_n+a_n)(c_n+b_n)}}{2}$$

$$L(a_0,b_0,c_0)=\lim_{n \to \infty}a_n=\lim_{n \to \infty}b_n=\lim_{n \to \infty}c_n$$

We have:

$$L(1,1,1/2)=\frac{3 \sqrt{3}}{2 \pi }$$

$$L(1,1,1/\sqrt{2})=\frac{2 \sqrt{2}}{\pi}$$


Or another one:

$$a_{n+1}=\sqrt{a_n \frac{b_n+c_n}{2}},\quad b_{n+1}=\sqrt{b_n \frac{c_n+a_n}{2}},\quad c_{n+1}=\sqrt{c_n \frac{a_n+b_n}{2}}$$

$$M(a_0,b_0,c_0)=\lim_{n \to \infty} a_n=\lim_{n \to \infty} b_n=\lim_{n \to \infty} c_n$$

$$M(1,1,2)=\frac{3^{3/4}}{\sqrt{\pi}}$$

$$M(1,1,\sqrt{2})=\frac{2}{\sqrt{\pi}}$$


There's a more simple (and famous) Arithmetic-Geometric mean, but as far as I know, it doesn't give $\pi$ on its own, but rather more complicated constant, involving Gamma function (Gauss' constant).

Yuriy S
  • 31,474
2

I'll point out that any summative formula can be turned into a recursive one: $$f(1) = 1, \quad f(n) = f(n-1) + \frac{1}{n^2}$$ has $\lim_{n \to \infty} f(n) = \frac{\pi^2}{6}$.

B. Mehta
  • 12,774
2

You may compute the coefficients of a generalized Shafer-Fink inequality with high order and evaluate it at $1$ (or at $\frac{1}{\sqrt{3}}$, or at $\sqrt{2}-1$). The first approximations produced by this approach are

$$ \pi\approx \frac{12}{1+2\sqrt{2}},\qquad \pi\approx\frac{180}{7+6\sqrt{2}+16\sqrt{4+2\sqrt{2}}} $$ $$ \pi\approx \frac{18}{13}(4-\sqrt{3}),\quad \pi\approx\frac{270 \sqrt{3}}{21+12 \sqrt{3}+32 \sqrt{3 \left(2+\sqrt{3}\right)}}$$ $$\pi\approx \frac{24 \left(\sqrt{2}-1\right)}{1+2 \sqrt{4-2 \sqrt{2}}},\quad \pi\approx \color{green}{\frac{360 \left(\sqrt{2}-1\right)}{7+6 \sqrt{4-2 \sqrt{2}}+16 \sqrt{2 \left(4-2 \sqrt{2}+\sqrt{4-2 \sqrt{2}}\right)}}}$$ and an hybridation with other classical approaches (continued fractions, Taylor expansions at peculiar points and Machin-like formulas) is also possible and pretty simple.

Jack D'Aurizio
  • 353,855
  • If I am right, the OP is asking for a fixed-point method (what he calls recursive, presumably not in the technical sense of a primitive recursive function). IMO, there are no "useful" answers. –  Apr 16 '18 at 06:43
  • @YvesDaoust: the determination of the coefficients for a generalized Shafer-Fink inequality is, essentially, a fixed point problem, since it boils down to inverting a structured matrix (Vandermonde-like) with dimension $n$. – Jack D'Aurizio Apr 16 '18 at 09:54
1

Here is a recursive approach to calculate $\pi$. Since

$$\tan^{-1}x=2\sum\limits_{n=1}^{\infty }{\frac{1}{2n-1}\frac{{{a}_{n}}\left( x \right)}{a_{n}^{2}\left( x \right)+b_{n}^{2}\left( x \right)}}, $$ where $$\begin{align} & {{a}_{1}}\left( x \right)=2/x, \\ & {{b}_{1}}\left( x \right)=1, \\ & {{a}_{n}}\left( x \right)={{a}_{n-1}}\left( x \right)\left( 1-4/{{x}^{2}} \right)+4{{b}_{n-1}}\left( x \right)/x, \\ & {{b}_{n}}\left( x \right)={{b}_{n-1}}\left( x \right)\left( 1-4/{{x}^{2}} \right)-4{{a}_{n-1}}\left( x \right)/x. \\ \end{align}$$

we can use, for example, $\tan^{-1}(1)=\pi/4$ by taking $x=1$. I hope this is an answer on your question.

0

Perhaps you'd be interested in something like Borwein's algorithm or the Brent-Salamin algorithm. See this Wikipedia article for Borwein's algorithm or here for Brent–Salamin. There are several StackExchange posts related to calculating $\pi$ as well, e.g this one.

sharding4
  • 4,917
-1

Your question is not very clear, in case of $\phi$ we calculate $\phi(n)$ but we do not calculate $\pi(n)$. $\pi$ is a constant, and you want recursive formula, so from the context i assume you want to calculate the value of $\pi$ using a recursion. To calculate value of $\pi$ using recursion you can use any of the formula listed above.
e.g.
$\pi = \displaystyle \prod_{n=1}^{\infty} \cfrac{2n}{2n -1} \cfrac{2n}{2n - 1} $
You can do like this
$\pi =\lim_{z \to \infty} \displaystyle \prod_{n=1}^{z} \cfrac{2n}{2n -1} \cfrac{2n}{2n - 1} $
$\pi(z) = \displaystyle \prod_{n=1}^{z} \cfrac{2n}{2n -1} \cfrac{2n}{2n - 1} \implies \pi(z) = \pi(z-1) \cfrac{2z}{2z -1} \cfrac{2z}{2z - 1}$
More the value of z more accurate value of $\pi$ you will get.

kayush
  • 2,441