Skip to main content

Library of Mathematical functions and Algorithms

Project description

https://img.shields.io/pypi/v/mathslib.svg Documentation Status

mathslib is a compilation of Mathematical Functions and Algorithms I have made or come across. I have used most of these for Project Euler.

See my website ivl-projecteuler.com for their implementation

See the full documentation here

Breakdown

numtheory.py

  • divisors_of(x, include_x)

  • divisors(x, n)

  • continued_fraction(x)

  • overall_fraction(x)

  • phi(x)

  • phi_sieve(x)

  • mobius(x)

  • mobius_k_sieve(limit, k)

  • count_k_free(n, k)

  • ppt(limit, non_primitive)

  • k_smooth_numbers(max_prime, limit)

  • k_powerful(k, limit, count)

  • legendre_factorial(x)

  • tonelli_shanks(a, p)

  • ChineseRemainderTheorem(a1, a2, n1, n2)

  • Generalised_CRT(a1, a2, n1, n2)

  • FrobeniusNumber(*integers)

prime.py

  • prime_sieve(limit, block_size, segment, values)

  • is_prime(x)

  • prime_factors(x)

  • primepi(x)

  • sum_of_primes(x)

  • fermat_primality_test(x)

  • miller(n, millerrabin, numoftests)

linalg.py

  • GaussJordanElimination(matrix, augmentedpart)

  • solve(M, b)

  • inverse(matrix)

  • determinant(matrix)

  • matrix_addition(A, B, subtract)

  • identity(l, val)

  • concatenate(A, B)

  • argmax(alist)

  • fillmatrix(size, val)

  • matrix_mul(A, B)

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, no_values)

simple.py

  • n_choose_r(n, r)

  • numberToBase(n, b)

  • ExtendedEuclideanAlgorithm(n, b)

  • lcm(a_list)

  • ModDivision(a, b, m)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mathslib-2.6.0.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

mathslib-2.6.0-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

Details for the file mathslib-2.6.0.tar.gz.

File metadata

  • Download URL: mathslib-2.6.0.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.5

File hashes

Hashes for mathslib-2.6.0.tar.gz
Algorithm Hash digest
SHA256 4942439a6bff1fc0be1994c80168ded70f64f24e549d6c8f4e55bfc9231bf7be
MD5 e0561bbc480bde6af82777f566d5b9de
BLAKE2b-256 99be77eedf3381ad0f9a92b68cf3f690795128ac21158b4d96e55a8383b60f22

See more details on using hashes here.

File details

Details for the file mathslib-2.6.0-py3-none-any.whl.

File metadata

  • Download URL: mathslib-2.6.0-py3-none-any.whl
  • Upload date:
  • Size: 24.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.5

File hashes

Hashes for mathslib-2.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 13c091d5619ae91a812afe7c8b83d8307ad9815e2b2026571a0ca9d3a7e89eb7
MD5 b1c6cd15d9d0b6952f5cd17ec3730214
BLAKE2b-256 2c6c5c6112da85204fc50aac999014675881a3081957bd41d6f8b6ef05f44067

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page