File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ def isPrime (n : Nat) : Bool := Id.run do
1010def isMultipleOf2Primes (a : Nat) : Bool := Id.run do
1111 let mut i := 2
1212 while i * i ≤ a do
13- if i ∣ a ∧ isPrime i then
13+ if i ∣ a then
1414 return isPrime (a / i)
1515 else
1616 i := i + 1
@@ -19,15 +19,13 @@ def isMultipleOf2Primes (a : Nat) : Bool := Id.run do
1919def isMultipleOf3Primes (a : Nat) : Bool := Id.run do
2020 let mut i := 2
2121 while i * i * i ≤ a do
22- if i ∣ a ∧ isPrime i then
22+ if i ∣ a then
2323 return isMultipleOf2Primes (a / i)
2424 else
2525 i := i + 1
2626 return false
2727
2828def isMultiplyPrime (a : Nat) : Bool :=
29- -- This solution checks if a number is the multiplication of 3 primes,
30- -- not necessarily different using O(a^(1/3)) operations.
3129 isMultipleOf3Primes a
3230
3331example : isMultiplyPrime 5 = false := by native_decide
You can’t perform that action at this time.
0 commit comments