Builidng Better Solutions For Web Development Recent WorkHow We Work
ProjectEuler.net
P1 | P2 | P3 | P4 | P5 | P6 | P7 | P8 | P9 | P10 | P22

Project Euler.net Answers

Problem 9

Solved on 2/26/2008

A Pythagorean triplet is a set of three natural numbers, a<b<c, for which,

a² + b² = c²

For example, 3² + 4² = 9 + 16 = 25 = 5².

There exists exactly one Pythagorean triplet for which a + b + c = 1000.
Find the product abc.

for($a = 1; $a<500; $a++){
for($b = 500-$a; $b<500; $b++){
$c = 1000-$a-$b;
if( ($c*$c) == ($a*$a+$b*$b)){
$this->a = $a;
$this->b = $b;
$this->c = $c;
$a=500;
$b=500;
}
}
}
$a = 200
$b = 375
$c = 425
$answer = 31,875,000

Latest News
Feb. 11, 2008
Wells Ideas Inc. launches their redesigned site.

The site is built on a symfony platform and utilizes client information from their project management site.
Quote Of The Day
"The greatest challenge to any thinker is stating the problem in a way that will allow a solution."
- Bertrand Russell