Last active
August 29, 2015 14:14
-
-
Save pqcfox/4a89f6ec6e92c65eaf17 to your computer and use it in GitHub Desktop.
A PPT generator which uses the formulae derived in Chapter 3 regarding the unit circle and Pythagorean triples.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def rprime(x, y): | |
| for d in range(2, min(x, y) + 1): | |
| if x % d == 0 and y % d == 0: | |
| return False | |
| return True | |
| for u in range(1, 26): | |
| for v in range(1, u): | |
| a = u**2 - v**2 | |
| b = 2*u*v | |
| c = u**2 + v**2 | |
| if (u + v) % 2 != 0 and rprime(u, v): | |
| print(a, b, c) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment