Pythagoras question [closed]

Hello everybody :)

This is my first question in this forum, so hopefully I'm doing it right. I wonder if there is an easy formula to calculate how many pythagorean triangles have the same circumfirence. Co for example:

A rectangular triangle with circumfirence 36 can only be one with sides 9 and 12 and hypothenusa 15. So there's only 1 possibility as can easily be found out by trial and error.

However, for a triangle with circumfirence 120 there are 3 possibilies:

Sides 30 and 40, hypothenusa 50. Sides 20 and 48, hypothenusa 52. Sides 24 and 45, hypothenusa 51.

(This also is not difficult to see.)

A Triangle with circumfirence 20 of course doesn't have pytagorean properties.

I'm looking for the general case. Is there a formula, or could I develop one, to find out the number of these pythagorean triads?

Lisette

-
Hi (a) Your question may be better suited for math.stackexchange.com ; while there is large overlap of readership (so your question reaches the many of the same people), we like to keep MathOverflow focused on problems arising for current research in mathematics. (b) You should specify that you are only allowing triangles with integer sides. Then your problem boils down to computing the number of solutions to the the Diophantine equation $$a^2 + b^2 = (n - a - b)^2$$ for a fixed $n$. Which boils down to finding the number of ways to factor $n^2/2$ into pairs of $<n$ numbers. – Willie Wong Dec 1 2011 at 12:22
@Willie: this is actually a complete answer, so maybe you should make it such... (and I agree that the question is not appropriate, but...) – Igor Rivin Dec 1 2011 at 12:27
Using the formulas on en.wikipedia.org/wiki/Pythagorean_triple one calculates that given a circumference d, that the number of corresponding pythagorean triples is the number of ways to write d as 2km(m+n), with m > n > 0, m,n coprime and m-n odd. – Koen S Dec 1 2011 at 12:27
Thanks for these answers. As I said this was my first post. So thank you again for your patience. – unknown (google) Dec 1 2011 at 13:46
@unknown, I was going to respond to a comment you made below mine, but it looks like you deleted it. I was just going to reiterate Willie Wong's point that your question, which is really a very nice one, would be well received at stackexchange. It was only closed here because it's on the elementary side. "Elementary" is not a pejorative, it's just not what mathoverflow is intended for. – Barry Cipra Dec 1 2011 at 18:04