## Math Problem

I found this sum in a book, and it gave the answer without any inkling of a clue as to why it’s correct. Can anyone help me?

Let r(n) be the number of ways n can be written as the sum of two squares of integers that need not be positive, and order is important. For example, r(2)=4 because

2=
1^2+1^2=
1^2+(-1)^2=
(-1)^2+1^2=
(-1)^2+(-1)^2.

Evaluate

sum from n=1 to infinity (-1)^n*r(n)/n.

Any ideas?

In other news, I got a new monitor yesterday. Yay!

Hi. I'm Simon Rubinstein-Salzedo. I'm a mathematics postdoc at Dartmouth College. I'm also a musician; I play piano and cello, and I also sometimes compose music and study musicology. I also like to play chess and write calligraphy. This blog is a catalogue of some of my thoughts. I write them down so that I understand them better. But sometimes other people find them interesting as well, so I happily share them with my small corner of the world.
This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

### 11 Responses to Math Problem

1. aknoln says:

First of all I think you need a new math book if yours is going to say: 1=1^2+1^2

• Simon says:

Bleh. I said that, not my book. I meant 2. I’m just incompetent.

2. nightsword04 says:

I haven’t really gotten anywhere though, except I’m going to guess that the answer is in the vicinity of
-2?

• Simon says:

It’s -pi*ln(2), which isn’t that far off from -2 if my random numerical approximations I’ve done quickly in my head are right.

3. Anonymous says:

you may be interested in http://mathworld.wolfram.com/SumofSquaresFunction.html. however, if what you listed is a problem solvable by elementary mathematics, i’m curious.
maybe try decomposing into bunch of alternating 1/n functions. still seems to require getting an explicit formula..
1/1 – 1/2 + 1/3 – 1/4… = ln2, but you knew that.

• Simon says:

I saw the MathWorld one, and they posted a similar sum, but not the alternating one, if I remember correctly. You’re right. I did know that the alternating harmonic series comes to ln(2). I’m just curious: who are you?

4. nightsword04 says:

Here’s what someone on the MATHCOUNTS message board said when I asked. I am not sure if it makes any sense since I’m still on precalc and don’t even know what a natural log is.
sum (from 1 to n) (r(n) , when n is very large is roughly pi*r^2.
This is very easy to see. r(n) is nothing but number of lattice points on a circle of radius sqrt(n) and center at the origin. So the sum, (if you disregard the boundary points) is roughly equal to the area of the circle.
To get to the same point, there is a beautiful theorem in number theory:
Take any positive integer n. Find all its factors. If ‘a’ of these factors are of the form 4k+1, and ‘b’ are of the form 4k-1. then r(n) is nothing but 4*(a-b)
example: n = 5
factors = 1, 5 … a=2, b=0 … r(n)=8
n=65
factors = 1,5,13,65 .. a=4, b=0 r(n)=8
n=2
factors 1,2 .. a=1 b=0 .. r(n)=4
Now comes interesting part.. can you see why your expression can be derived by knowing two serieses:
(pi/4) = 1 -(1/3) + 1/5 – 1/7 …
and
ln(2) = 1 – (1/2) + 1/3 – 1/4

• Simon says:

r(65)=16, not 8, since 65=1^2+8^2=4^2+7^2.

• Simon says:

But I guess that person only wrote 8 because it’s a mistake, since 4*4=16.

5. This sum looks pretty tough. First of all it’s only conditionally convergent so you can’t do whatever you want to it (I realized that only after “proving” the sum equal to zero).
What I was trying to do was use the fact that r(n)/4 is a multiplicative function (this is true because r(n) is the number of ways n can be written as (a+ib)(a-ib) where a and b are integers, so you can do nice stuff with unique factorization over Gaussian integers) to factor the sum above. This is how I “proved” the sum equal to 0: so much for that approach.
I’m not sure how to go about it any other way, though.

6. This sum looks pretty tough. First of all it’s only conditionally convergent so you can’t do whatever you want to it (I realized that only after “proving” the sum equal to zero).
What I was trying to do was use the fact that r(n)/4 is a multiplicative function (this is true because r(n) is the number of ways n can be written as (a+ib)(a-ib) where a and b are integers, so you can do nice stuff with unique factorization over Gaussian integers) to factor the sum above. This is how I “proved” the sum equal to 0: so much for that approach.
I’m not sure how to go about it any other way, though.
–Alison, who can’t resist a good math problem