Representing the area of a circle as the sum of circumferences

Your algorithm computes the following: $$ P = \frac{1}{10^n} \sum_{\substack{i \ge 0 \\ r - 10^{-n} i > 0 }} 2 \pi (r - 10^{-n} i) $$ For simplicity, let's assume that $r$ is an integer multiple of $10^{-n}$; for example, $r$ is an integer. Then we can write this as $$ P = \frac{1}{10^n} \sum_{j = 1}^{10^n r}2 \pi j $$ This is a Riemann sum (and thus a good approximation for) for the integral $$ \int_{0}^r 2 \pi r' \; dr' = \pi r^2, $$ and the approximation gets better the more subintervals you have, i.e. the higher $n$ is.

You have good intuition -- the area of the circle can be thought of as the sum of the (infinitely many) lengths of all of the circumferences you can draw inside it with smaller radius. This is what the above says. In calculus terms, the integral of circumference is area. This is why your algorithm works.


Your clever algorithm approximates the circle by a union of annuli of radius $r/10^n$. The area of each annulus is its circumference times its width.

This is a standard argument in calculus. Archimedes would have appreciated it.