!pip install pytest
#!pip install numpy
!pip install git+https://github.com/laguer/primefinders#egg=primefinders
!pip list
from primefinders import primefinders
primefinders.about()
'primefinders.check(n)' returns 'True' if 'n' is a prime number 'primefinders.factor(n)' returns the lowest prime factor of 'n' 'primefinders.factors(n)' returns all the prime factors of 'n' with multiplicity 'primefinders.first(n)' returns first 'n' many primes 'primefinders.upto(n)' returns all the primes less than or equal to 'n' 'primefinders.between(m,n)' returns all the primes between 'm' and 'n' 'primefinders.phi(n)' returns the Euler's phi(n) 'primefinders.lcg(n)' example of Linear Congruential Generator 'primefinders.getResult(n)' returns 'True' if 'n' getResult 'primefinders.calculate(n)' returns 1 if 'n' is prime 'primefinders.fermat(n)' returns 1 if 'n' is prime using fermat a ** (n - 1)) % n) 'primefinders.check_complex(n)' returns 1 if 'n' might be prime it said to be complex
primefinders.check(137)
True
primefinders.phi(137)
136
primefinders.phi(136)
64
primefinders.phi(64)
32
primefinders.phi(32)
16
primefinders.phi(16)
8
import numpy
numpy.__version__
#print(primefinders.__version__)
'1.16.3'
from primefinders import primefinders
primefinders.phi(137)
print(primefinders.phi(137))
136
from primefinders import primefinders
primefinders.phi(137)
136
from primefinders import primefinders
#import numpy
import pytest
#assert(numpy.__version__ == '1.15.4')
#assert(primefinders.phi(137) == 136)
#assert(primefinders.phi(136) == 64)
assert(primefinders.check(137) == True)
# change this to false if you want to test exceptions
assert True
assert(primefinders.phi(137) == 136)