maths.odd_sieve

Functions

odd_sieve(→ list[int])

Returns the prime numbers < num. The prime numbers are calculated using an

Module Contents

maths.odd_sieve.odd_sieve(num: int) list[int]

Returns the prime numbers < num. The prime numbers are calculated using an odd sieve implementation of the Sieve of Eratosthenes algorithm (see for reference https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes).

>>> odd_sieve(2)
[]
>>> odd_sieve(3)
[2]
>>> odd_sieve(10)
[2, 3, 5, 7]
>>> odd_sieve(20)
[2, 3, 5, 7, 11, 13, 17, 19]