A compilation of Mathematical Functions and Algorithms I have made or come across.
I have used most of these for Project Euler
You can see their implementation on my website ivl-projecteuler
| Modules |
Functions |
| numtheory.py |
divisors_of(x, include_x)
divisors(x, n)
continued_fraction(x)
continued_fraction(x)
overall_fraction(x)
phi(x)
Mobius(x)
ppt(limit, non_primitive)
legendre_factorial(x)
k_smooth_numbers(max_prime, limit)
legendre_symbol(a, p)
tonelli_shanks(a, p)
ChineseRemainderTheorem(a1, a2, n1, n2)
|
| prime.py |
Prime_Sieve(limit, block_size, segment, values)
is_prime(x)
prime_factors(x)
|
| fib.py |
fibonacci(n)
fib_till(limit)
ZeckendorfRepresentation(x)
|
| algorithms.py |
PrimsAlgorithm(matrix)
DijkstrasAlgorithm(matrix, start_node, end_node)
KnapSack(values, weights, n, W, no_values)
KnapSackValues(values, weights, n, W)
|
| simple.py |
n_choose_r(n, r)
numberToBase(n, b)
lcm(a_list)
ModDivision(a, b, m)
|