Is it possible to bound the hypotenuse given the perimeter of an orthogonal triangle?

132 Views Asked by At

I am working on Project Euler's problem 9, which needs you to calculate the product of a pythagorean triplet which sums to 1000.

Therefore we have:

  1. $a < b < c$
  2. $c^2=a^2+b^2$
  3. $a+b+c=1000$

I was wondering if there is a way to find an upper bound for $c$, not in terms of $a$ or $b$.

2

There are 2 best solutions below

3
On BEST ANSWER

$$a+b+c = 1000$$ $$a^2 + b^2 + c^2 +2ab +2bc + 2ac = 1000000$$ $$ 2c^2 +2ab + 2(a+b)c = 1000000$$ $$c^2 + ab + (1000-c)c = 500000$$ $$ab + 1000c = 500000$$ $$c = 500 - \frac{ab}{1000}$$

So $$c < 500$$ is given.

Now, can we do better? Well we know from (1) that $ab < ac < c^2 < 250000$ so we also know $c>250$, so we're pretty close to the actual upper bound.

0
On

A different approach that fix $c$.

Use the fact that a Pythagorean triple can be generated as:

$$ a=m^2-n^2 \qquad b=2mn \qquad c=m^2+n^2 $$ by two integers $m>n>0$

so, from $a+b+c=1000$ we have: $$ m^2+n^2+m^2-n^2+2mn=1000 \Rightarrow m(m+n)=500 \Rightarrow n=\frac{500}{m}-m $$ Now check the divisors of $500$ for the given conditions on $m,n$ and you find: $m=20$ $n=5$. This gives $c=425$, $b=250$ and $a=375$ that is the Pythagorean triple with $a+b+c=1000$ and the maximum $c$.