changeset 354 | 5dc6c3673f9d |
parent 94 | 8c92864c184b |
child 380 | 669b72283b55 |
353:8999d0a3fc9d | 354:5dc6c3673f9d |
---|---|
8 if a % b == 0: |
8 if a % b == 0: |
9 return b |
9 return b |
10 else: |
10 else: |
11 return gcd(b, a%b) |
11 return gcd(b, a%b) |
12 |
12 |
13 a = 3 |
13 for a in range(3, 501): |
14 while a < 100: |
14 for b in range( a+1, 501, 2): |
15 b = a + 1 |
15 if gcd( a, b ) == 1: |
16 while b < 100: |
16 is_ps, c = is_perfect_square((a * a) + (b * b)) |
17 is_ps, c = is_perfect_square((a * a) + (b * b)) |
17 if is_ps: print a, b, c |
18 if is_ps and gcd(a, b) == 1: |
|
19 print a, b, c |
|
20 b += 1 |
|
21 a += 1 |