# Script:Math:primitive-pythagorean-triples.scm

### From Gambit wiki

(Difference between revisions)

(Script:Math:primitive-pythagorean-triples.scm) |
|||

Line 13: | Line 13: | ||

for (int j=i; j<n; j++) | for (int j=i; j<n; j++) | ||

{ | { | ||

- | + | double x = sqrt(i*i + j*j); | |

if (x == floor(x) && gcd(i,j) == 1) | if (x == floor(x) && gcd(i,j) == 1) | ||

println(i,"^2 + ",j,"^2 = ",x,"^2"); | println(i,"^2 + ",j,"^2 = ",x,"^2"); |