pynum
A python library what works with numbers.
Prime
Prime class have everithing you want about prime numbers.
check_prime
The check_prime method is used to check "is n prime?"; it returns a boolean.
Algorithm
I dont know how to write algorithms in markdown so if you can do it I'll be happy if you do it.
Example
import pynum
p = pynum.Prime(12)
print(p.check_prime())
#Result: False
or
import pynum
p = pynum.Prime(29)
if p.check_prime():
print('Right, that\'s prime.')
else:
print('No, that\'s not prime.')
# Result: Right, That's prime.
Sieve
Seive class have everithing you want to sieve numbers and ect...
primes
Primes method returns the prime numbers from 1 to a number you giving it.
Algorithm
I dont know how to write algorithms in markdown so if you can do it I'll be happy if you do it.
Example
import pynum
s = pynum.Sieve(40)
print(s.primes())
# Result: [1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]