In Pi different ways
Let P(n) be the number of ways to represent n as the sum of 2 squares. We count ordered pairs of squares of positive and negative integers, e.g. P(2) = 4 : (-1)^2+(-1)^2 = (-1)^2+(1)^2 = (1)^2+(-1)^2 = (1)^2+(1)^2.
What is the average value of P(n), i.e. lim ( P(1)+…+P(k) )/k ?
The answer is Pi.
The proof is very simple and doesn’t involve any number theory.
P(k) is the number of integer points on a circle of radius sqrt(k).
So P(1)+…+P(k) is the number of integer points inside (or on) that cirlce. (Why?)
In the limit it can be approximated by the area of the circle, or Pi*k. So the answer is Pi. (Why?)
This proof is obviously correct, but it lacks rigor. I leave answering the whys up to the reader.