mirror of
https://github.com/heqin-zhu/algorithm.git
synced 2024-03-22 13:30:46 +08:00
4 lines
120 B
Haskell
4 lines
120 B
Haskell
genPrimes 2= [2]
|
|
genPrimes n = let li = genPrimes $n-1
|
|
in if all (\x-> mod n x /=0) li then n:li else li
|