You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: generators/number_theory.py
+7-11Lines changed: 7 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,13 @@
11
11
classFermatsLastTheorem(PuzzleGenerator):
12
12
"""[Fermat's last theorem](https://en.wikipedia.org/w/index.php?title=Fermat%27s_Last_Theorem)
13
13
14
-
Find integers a,b,c > 0, n > 2, such such that `a ** n + b ** n == c ** n`
15
14
Supposedly unsolvable, but how confident are really in the super-complicated proof?
16
15
17
16
See [Wiles, Andrew. "Modular elliptic curves and Fermat's last theorem." Annals of mathematics 141.3 (1995): 443-551.](https://www.jstor.org/stable/2118559)"""
18
17
19
18
@staticmethod
20
19
defsat(nums: List[int]):
20
+
"""Find integers a,b,c > 0, n > 2, such such that a^n + b^n == c^n"""
21
21
a, b, c, n=nums
22
22
return (a**n+b**n==c**n) andmin(a, b, c) >0andn>2
23
23
@@ -28,12 +28,11 @@ class GCD(PuzzleGenerator):
28
28
"""[Greatest Common Divisor](https://en.wikipedia.org/w/index.php?title=Greatest_common_divisor&oldid=990943381)
29
29
(GCD)
30
30
31
-
Find the greatest common divisor of two integers.
32
-
33
31
See also the [Euclidean algorithm](https://en.wikipedia.org/wiki/Euclidean_algorithm)"""
34
32
35
33
@staticmethod
36
34
defsat(n: int, a=15482, b=23223, lower_bound=5):
35
+
"""Find a large common divisor of two integers."""
37
36
returna%n==0andb%n==0andn>=lower_bound
38
37
39
38
@staticmethod
@@ -66,12 +65,11 @@ class GCD_multi(PuzzleGenerator):
66
65
"""[Greatest Common Divisor](https://en.wikipedia.org/w/index.php?title=Greatest_common_divisor&oldid=990943381)
67
66
(GCD)
68
67
69
-
Find the greatest common divisor of a *list* of integers.
70
-
71
68
See also the [Euclidean algorithm](https://en.wikipedia.org/wiki/Euclidean_algorithm)"""
0 commit comments