Moved (VERY incomplete) primefac reimplementation
This commit is contained in:
parent
87917f9526
commit
fa60bc5dd7
2 changed files with 16 additions and 0 deletions
10
primegen.nim
Normal file
10
primegen.nim
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
iterator primegen(limit: int = high(BiggestInt)): int:
|
||||
"""
|
||||
Generates primes < limit almost lazily by a segmented sieve of Eratosthenes.
|
||||
Examples:
|
||||
>>> primegen().take(20)
|
||||
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71]
|
||||
>>> primegen(73).toSeq()
|
||||
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71]
|
||||
"""
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue