Project Euler Solutions by Ross Marks

<?php
/*****************************
 * ProjectEuler - Problem 9
 * By Ross Marks
 *****************************
 * A Pythagorean triplet is a set of three natural numbers, a < b < c, for which,
 *
 * a2 + b2 = c2
 * For example, 32 + 42 = 9 + 16 = 25 = 52.
 *
 * There exists exactly one Pythagorean triplet for which a + b + c = 1000.
 * Find the product abc.
 ****************************/

for($a 0$a <= 8000$a++){
    for(
$b 0$b <= 8000$b++){
        
$a2 bcpow($a2);
        
$b2 bcpow($b2);

        
$c2 bcpow($a2)+bcpow($b,2);
        
$c sqrt($c2);
        
$sum $a+$b+$c;

        if(
$sum == 1000){
            if((
$a2+$b2) == $c2){
                if(
$a2<$b2 && $b2<$c2){
                    
$answer $a*$b*$c;
                    echo 
$a2." ".$b2." = ".$c2." abc: $a$b$c sum=$sum\n";
                    echo 
"Awnser: ".$answer."\n";
                    die();
                }
            }
        }
    }
}

?>