maths.sieve_of_eratosthenes =========================== .. py:module:: maths.sieve_of_eratosthenes .. autoapi-nested-parse:: Sieve of Eratosthones The sieve of Eratosthenes is an algorithm used to find prime numbers, less than or equal to a given value. Illustration: https://upload.wikimedia.org/wikipedia/commons/b/b9/Sieve_of_Eratosthenes_animation.gif Reference: https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes doctest provider: Bruno Simas Hadlich (https://github.com/brunohadlich) Also thanks to Dmitry (https://github.com/LizardWizzard) for finding the problem Functions --------- .. autoapisummary:: maths.sieve_of_eratosthenes.prime_sieve Module Contents --------------- .. py:function:: prime_sieve(num: int) -> list[int] Returns a list with all prime numbers up to n. >>> prime_sieve(50) [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47] >>> prime_sieve(25) [2, 3, 5, 7, 11, 13, 17, 19, 23] >>> prime_sieve(10) [2, 3, 5, 7] >>> prime_sieve(9) [2, 3, 5, 7] >>> prime_sieve(2) [2] >>> prime_sieve(1) []