Sums Of Squares

New puzzle time? New puzzle time.

I first found this one at Futility Closet:
Consider the number of ways a positive integer can be written as the sum of two integer squares, for example, 8 can be written four ways, m2+n2 as (m,n)=(2,2), (-2,2), (2,-2), (2,2), while 5 can be done eight ways (2,1), (-2,1), (2,-1), (-2,-1), (1,2), (-1,2), (1,-2), (-1,-2), and 7 cannot be written as the sum of two squares at all.

Over a very large collection of integers from 1 to N, the average number of ways a number can be written as the sum of two squares approaches π, why should this be?

Just in case we are using different browsers, π is supposed to render as pi, it looks a bit funny in firefox.

The puzzle is a bit of a weird one, being something of a proof more than anything, but there is a proof that can be understood only using high school math, so I don't think its too tricky. There are probably more convoluted proofs, of course, being that π is involved.

No comments: