Skip to main content

eratosthenes

Function eratosthenes 

Source
pub fn eratosthenes(first_candidate: u64) -> impl Iterator<Item = u64>
Expand description

The primes in order from first_candidate up: music21’s eratosthenes.

An incremental sieve: each prime found is filed under its next multiple, so a candidate that is nobody’s multiple is prime and the primes need no upper bound. The iterator is endless.