My new favorite way to calculated pi! The average number of ways to add two squares to get a natural number n is pi. The variable 'pi' will (very slowly) approach the true value of pi. It'd be nice to be able to do this from the prime factorization...
Just a quick experiment, inspired by George Andrews' book "Number Theory" (great book, by the way).