Recently I noticed the following derivation of the formula for the
number of representations of an integer N>0 as the sum of two squares,
using modular forms but practically no arithmetic. I'm almost sure
that this must be known, but can't recall having seen it before and
don't know where to look for a reference. Does anybody on this forum
recognize it?
Thanks,
--Noam D. Elkies
22222222222222222222222222222222222222222222222222222222222222222222222
Start from the fact that sech(Pi*x) is its own Fourier transform,
a standard application of contour integration. Use Poisson summation
to deduce that
F(tau) := sum(m=-infty,infty, sech(m*Pi*I*tau))
(tau in the upper half-plane) is a modular form of weight 1, with
F(tau) = F(tau+2) = (-1/tau) F(-1/tau),
same as for the theta function
theta_{Z^2}(tau) = sum((m,n) in Z^2, exp((m^2+n^2)*Pi*I*tau)).
Since the space of such modular forms is 1-dimensional, and
both F(tau) and theta_{Z^2}(tau) approach 1 as tau --> I*infty,
it follows that F = theta_{Z^2}. Now expand F in powers of
q = exp(2*Pi*I*tau):
F(tau) = 1 + 4 * sum(m=1,infty, q^(m/2) / (1+q^m))
= 1 + 4 * sum(m=1,infty,sum(d=1,infty, chi(d) q^(dm/2) ))
where chi(.) = (-1/.) is the Dirichlet character mod 4. Thus for N>0
the q^(N/2) coefficient of F is 4 times the multiplicative function
whose value at a prime power p^v is
1, if p=2,
v+1, if p is 1 mod 4, and
(1+(-1)^v)/2, if p is -1 mod 4.
Hence this is also the number of representations N=x^2+y^2.