algorithm-in-python/math/numberTheory/primesLEn.hs

4 lines
106 B
Haskell
Raw Permalink Normal View History

genPrimes 2= [2]
genPrimes n = let li = genPrimes $n-1
2020-04-15 12:28:20 +08:00
in if all (\x-> mod n x /=0) li then n:li else li