# Thread: triangle with integer sides

1. ## triangle with integer sides

how can you find all right-angled triangle with integer sides if one of the sides is 2001 units long?

2. Originally Posted by Intsecxtanx
how can you find all right-angled triangle with integer sides if one of the sides is 2001 units long?
2001 is pretty small. You can generate all primitive Pythagorean triples until an upper bound, and use the prime factorization of 2001 when considering which multiples could lead to a side length of 2001. Look on Wikipedia for how to generate Pythagorean triples.

Edit: Actually, generating all the triples is probably overkill in this case, although it probably involves the least thought.

Using the equations from the Wikipedia page, you can set one of a, b, c equal to 2001. Obviously, 2mn can't equal 2001 or any of its factors. For the other two, you might want to use Dario Alpern's online quadratic Diophantine solver. (The link is the JavaScript version, I believe. A faster version is a Java applet but the speed increase won't be noticeable for such small numbers.)

Edit 2: The only factor of 2001 that could equal m^2 + n^2 is 29. See here.

(Edited a mistake out too.)

Edit 3: m^2 - n^2 can be written (m-n)(m+n) which reduces it to a factorization problem.