> Or even > > for my $x (1..98) { > for my $y (1..(99-$x)) { > for my $z (1..(100-$x-$y)) { > print "$x, $y, $z\n" if $x ** 2 = $y ** 2 + $z ** 2; > } > } > }
Sure. Depending on whether you want combinations or permutations. Damian
> Or even > > for my $x (1..98) { > for my $y (1..(99-$x)) { > for my $z (1..(100-$x-$y)) { > print "$x, $y, $z\n" if $x ** 2 = $y ** 2 + $z ** 2; > } > } > }
Sure. Depending on whether you want combinations or permutations. Damian