\documentclass{article}
\usepackage{latexsym,eepic,makeidx,fancybox}
\usepackage[dvips]{graphicx} \usepackage[latin1]{inputenc} \usepackage[english]{babel} \usepackage{amstext,amssymb,amsmath,amsthm,youngtab}
\title{}
\date{}
\author{}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{proposition}{Proposition}[section]
\newtheorem{lemma}{Lemma}[section]
\newtheorem{conjecture}{Conjecture}[section]
\newtheorem{definition}{Definition}[section]
\newtheorem{remark}{Remark}[section]
\newtheorem{claim}{Claim}[section]
\newcommand{\p}{^\prime}
\newcommand{\pp}{^{\prime\prime}}
\newcommand{\lra}{\leftrightarrow}
\newcommand{\mbf}{\mathbf}
\newcommand{\mbb}{\mathbb}
\newcommand{\mcl}{\mathcal}
\begin{document} 
\maketitle

We will define a function $f(n)$ depending on an positive integer variable $n$.
Let $x$ be a temporary variable, initally set to $n$.
We'll change $x$ in $n$ steps, the final value being $f(n)$.
In the $i$th step we update $x$ to the smallest multiple of $n-i$ strictly larger than $x$.
\begin{proposition} $\lim_{n\to\infty} f(n)/n^2 = \frac{1}{\pi}$ \end{proposition}

Let's think about how the compiutation of $f(n)$ for a large $n$ begins.

The variable $x$ starts out as $n$.
Then we update it to $2(n-1)$. 
Next we update it to $3(n-2)$, unless $3(n-2) \leq 2(n-1)$, which is the same thing as $n\leq 2$.
Next, if $n > 6$ we update $x$ to $4(n-3)$.
If $n = 6$ we would have updated to $5(n-3)$ in this step instead.

Now we generalize these observations.
We know that after $k$ steps, $x$ is a multiple of $(n-k)$.
Define $m_k$ by letting $m_k(n-k)$ be this multiple.

So, when we make the $k$:th step, we update $x$ from $m_{k-1}(n-(k-1))$ to $m_k(n-k)$.
The final value of $x$ will be $m_{n-1}(n-(n-1)) = m_{n-1}$.
So our task is to estimate $m_{n-1}$.

It should be obvious that the pattern above persists; $m_k$ will be a sequence starting of as $1,2,3,4,\dots$ increasing in steps of one, then at some point it starts increasing in steps of two, and so on until we reach the final value $m_{n-1}$.

It is now natural to investigate in exactly which step the increments change from being $1$ to being $2$.

We know $m_k$ starts out as $m_k = k+1$.
For how long will this be true?
As long as $(k+1)(n-k) < (k+2)(n-(k+1))$, which can be simplified to $2(k+1) < n$.
The largest $k$ satisfying this is clearly $\frac{n-2}{2}$, so in roughly the first $\frac{1}{2}n$ steps we increment $m_k$ by $1$, after which we start incrementing it by $2$ instead.

We will not be very careful with small errors here, so approximating $\frac{n-2}{2}$ with $\frac{1}{2}n$ is fine.
Let's restate what we just found: during the first $f_1\cdot n$ steps, we increment $m_k$ by $1$, then start incrementing by $2$, where $f_1 = \frac{1}{2}$.
It seems reasonable to investigate the sequence $f_p$ for which the following statement is true: when we have already made $f_{p-1}\cdot n$ steps but not more than $f_p\cdot n$ steps, we increment $m_k$ by $p$.
So we have $f_0 = 0$. We should of $f_p$ as fractions of time: after a fraction $f_p$ of the total time (total number of steps) $n$, we start incrementing $m_k$ by $p+1$ instead of $p$.

Let's write down a formula for the definition of $f_p$ above.

Let $l = f_{p-1}n$.
We have $m_l = (f_1-f_0)n + 2(f_2-f_1)n + 3(f_3-f_2)n+\dots+(p-1)(f_{p-1}-f_{p-2})$, or $m_l = ((p-1)f_{p-1} - f_{p-2} - f_{p-3} -\dots -f_1-f_0)n$.
Now, let $f_{p-1}n < k < f_p n$.
Then $m_k = m_l + p(k-l)$.
At step $k(+1)$, we change $x$ from $m_k(n-k)$ to $(m_k+p)(n-k)$.
For this to be valid we must have $m_k(n-k) < (m_k+p)(n-k)$.
This can be simplified to $m_k < p(n-k)$ and using the formula for $m_k$, we get
$$
((p-1)f_{p-1} - (f_{p-2}+\dots+f_0))n < p(n-2k+f_{p-1}n)
$$.
Now, when $k = f_pn$, we have roughly equality above. Setting the sides equal and $k$ to $f_pn$ above we get (after some manipulation):
$$
f_p = \frac{1}{2} + \frac{1}{2p}(f_0+\dots+f_{p-1}).
$$

We have found (a recursion for) $f_p$!

The first few values are (knowing only $f_0 = 0$): $0, \frac{1}{2}, \frac{5}{8}, \frac{33}{48},\dots$.

We are now in a better position to understand $f(n)$: a good approximation is $n\left((f_1-f_0)+2(f_2-f_1)+\dots+p(f_p-f_{p-1})\right)$ for any fixed $p$.
It is easy to show that the approximation tends to perfect when $p$ tends to $\infty$ after already having let $n$ do so.

Again, let $k = nf_p$. After $k$ steps, our temporary variable $x$ is equal to $m_k(n-k) = \left(pf_p - (f_0+\dots+f_{p-1}\right)(n-nf_p) = n^2(1-f_p)(pf_p-(f_0+\dots+f_{p-1})$.

{\bf Problem, restated. Define a sequence $(f_p)_0 ^\infty$ by letting $f_0 = 0$ and $f_p = \frac{1}{2}\left(1 + (f_0+\dots+f_{p-1})/p\right)$.
Show that $(1-f_p)(pf_p-(f_0+\dots+f_{p-1})) \to \frac{1}{\pi}$ as $p\to\infty$.}

Consider 
$$
(1-f_p)(pf_p - (f_0+\dots+f_{p-1})).
$$

In the first parenthesis we have something simple. Then we have $f_p$ plus itself $p$(-1) times, minus a total of $p$ other $f_i$.
So the second parenthesis is translation invariant in a sense: replacing $f_i$ by $f_i +a$ for any constant $a$ does not change the value of the second parenthesis.
The first will be replaced by $(1-a-f_p)$, of course.
We should choose an $a \neq 0$ that suits us best.
For this we need to check what happens to the definition of the resulting numbers $g_p:=f_p+a$.
It will be 
$$
g_p = \frac{1}{2}(1+a) + \frac{1}{2p}(g_0+\dots+g_{p-1}).
$$

Letting $a = -1$ seems like a good idea, so we do that.
Then we define $g_0 = -1$, $g_p = (g_0+\dots+g_{p-1})/(2p)$ and should compute $\lim -g_p(pg_p-(g_0+\dots+g_{p-1})$.
The numbers $g_p$ are negative so we look at their negatives $h_p = -g_p$ instead.
Now we have $h_0 = 1$, $h_p = (h_0+\dots+h_{p-1})/(2p)$ and we should find $\lim h_p(h_0+\dots+h_{p-1} - ph_p)=\lim ph_p^2$.

Consider
$$
h_p = \frac{1}{2p}(h_0+\dots+h_{p-1}).
$$

Here, we have a sequence related with its corresponding sequence of partial sums, and something similar could be said about the expression whose limit we should compute.
The inverse operation of forming the sequence of partial sums is forming the sequence of consecutive differences, so there should be a version of this formula phrased in terms of the sequence $\sigma_p := f_0+\dots+f_p$ involving consecutive differences. It is
$$
\sigma_p - \sigma_{p-1} = \frac{1}{p}\sigma_p.
$$

But this is just $\sigma_p = \sigma_{p-1}(1+\frac{1}{2p})$.
This means that $\sigma_p$ is simply the product 
$$
\prod_{i=1} ^p (1+\frac{1}{2i}).
$$

Let's investigate what out limit looks like in terms of $\sigma_p$.

It is $\lim ph_p^2 = \lim (\sigma_p - \sigma_{p-1})^2$.

We factor out $\sigma_{p-1}$ from each parenthesis and get 
$$
\left(\sigma_{p-1}\right)^2 (\frac{\sigma_p}{\sigma_{p-1}}-1)^2 =
$$

$$
\left(\prod_{i=1}^{p-1} \left(1+\frac{1}{2i}\right)\right)^2 \frac{1}{4p^2} = 
$$

$$
\frac{1}{4p^2}\prod_{i=1}^p\left(\frac{2i+1}{2i} \right)^2.
$$

Wallis' formula is $\frac{1}{\pi} = \prod_{i=1} ^p \left(\frac{4i^2}{(2i-1)(2i+1)}\right)$, which is similar to our expression.
Dividing our expression by the right hand side in Wallis' formula should give $1$, and if we can prove this we are done.

Said quotient is 
$$
\frac{1}{2p+1} \prod_{i=1}^p \frac{(2i+1)^2}{(2i+1)(2i-1)} = \frac{1}{2p+1}\prod_{i=1}^p \frac{2i+1}{2i-1}=1,
$$
the last product being telescopic.


\end{document}
