One of my daughters was having a small programming exercise. 


Let's consider following algorithm:


* Take a list of length $n$: $\ (1\,\ 2\,\ \ldots\,\ n)$.
* Remove every $2$nd number.
* From the resulting list, remove every $3$rd number.
* From the resulting list, remove every $4$th number.
* ... Follow on until the list remains unchanged and let $u\_n$ be the number of remaining elements.


Example with $n=11$


* $(\ 1\,\ 2\,\ 3\,\ 4\,\ 5\,\ 6\,\ 7\,\ 8\,\ 9\,\ 10\,\ 11\ )\quad \Rightarrow\quad (\ 1\ \*\ 3\ \*\ 5\ \*\ 7\ \*\ 9 \ \*\ 11\ )$
* $(\ 1\,\ 3\,\ 5\,\ 7\,\ 9\,\ 11\ )\quad \Rightarrow\quad (\ 1\,\ 3\ \*\ 7\,\ 9\ \*\ )$
* $(\ 1\, 3\,\ 7\,\ 9\ )\quad \Rightarrow\quad (\ 1\,\ 3\,\ 7\ \*\ )$
* $(\ 1\,\ 3\,\ 7\ )\ $ -- will not be modified anymore, and therefore $u\_n=3$.


**QUESTION:**   why do we have $\lim\limits\_{n \to +\infty} \frac{n}{u\_n^2}=\frac{\pi}{4}$ ?


Thanks!



Why does this sequence converges to $\pi$?
This problem was studied first by the founder of sieve theory, Brun himself, who proved this asymptotic. For a fairly recent paper on this subject look at [Andersson](http://matwbn.icm.edu.pl/ksiazki/aa/aa85/aa8542.pdf) who gives more precise estimates for $u\_n$. The MO question [Sequences with integral means](https://mathoverflow.net/questions/146733/sequences-with-integral-means/146849#146849) is also closely related, and see also my answer there. 


