Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- s = []
- for n in range(3, 7):
- for a in range(1, 100):
- for b in range(a, 100):
- for c in range(b, 100):
- if a^n + b^n == c^n and a + b < c:
- s += [(a, n, b, n, c, n)]
- if len(s) > 0:
- print("Fermat's Last Theorem is false!")
- print("I found %d solution(s) with 1 ≤ a ≤ b ≤ c ≤ 99, 3 ≤ n ≤ 6!" % len(s))
- print("For example, %d^%d + %d^%d = %d^%d! Fermat lied!" % random.choice(s))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement