Compare commits
No commits in common. "7f9473097f82a492d9d73327b18ec42e84190c2d" and "269092fb53b9b02cf35e8f810ed8e3f83cd299ce" have entirely different histories.
7f9473097f
...
269092fb53
2 changed files with 0 additions and 16 deletions
|
|
@ -1,6 +0,0 @@
|
|||
`primefac-nim` is a translation of Lucas A. Brown's [primefac project](https://github.com/lucasaugustus/primefac)
|
||||
into Nim. Why? 1. I like his work and wanted it in Nim, 2. I'm trying to learn number theory.
|
||||
|
||||
Some functions are not verbatim translation, and will be marked as such.
|
||||
This allows me to implement my own optimisations, such as using
|
||||
the Sieve of Atkins for prime generation rather than the Sieve of Eratosthenes.
|
||||
10
primegen.nim
10
primegen.nim
|
|
@ -1,10 +0,0 @@
|
|||
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