0

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$.

Michael
  • 113
  • How about $1000$ ? –  Nov 19 '15 at 13:36
  • 2
    @G.Sassatelli: I think we can do even better; the next best upper bound is $500$... – abiessu Nov 19 '15 at 13:37
  • @G.Sassatelli how is $1000$ an option? It doesn't satisfy the pythagorean theorem. – Michael Nov 19 '15 at 13:43
  • He's saying that if you let c=999.99 then you can figure out values for a and b that satisfy all the first two properties. I was thinking the same thing but it seems like the third property decreases this upper bound to 500 according to the answer. – Yunus Syed Nov 19 '15 at 13:55
  • An upper bound for a set $S$ needs not be in $S$. I was saying that $c$ has an obvious upper bound in $1000$. Had you wanted the maximum possible value of $c$, that would have been a defferent story. –  Nov 19 '15 at 16:12

3 Answers3

1

$$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

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$.

Emilio Novati
  • 64,377
0

Let $(A+B+C)=P=(m^2-n^2 )+2mn+(m^2+n^2 )=2m^2+2mn$

$$\text{We factor for }n=\frac{P-2m^2}{2m}\text{ where }m=\biggl\lceil\frac{\sqrt{P}}{2}\space\biggr\rceil\le m\le\biggl\lfloor\sqrt\frac{P}{2}\biggr\rfloor$$

$$n=\frac{1000-2m^2}{2m}\text{ where }m=\biggl\lceil\frac{\sqrt{1000}}{2}\space\biggr\rceil=16\le m\le\biggl\lfloor\sqrt\frac{1000}{2}\biggr\rfloor=22$$ Given $P=1000$, we test $16\le m\le 22$ to see which yield an integer $n$.

We find only one where $f(20,5)=(375,200,425)$

poetasis
  • 6,795