https://github.com/bh2smith/numbertheorypython
Includes; Sieve of Eratosthenes, Euler-Phi, etc...
https://github.com/bh2smith/numbertheorypython
Last synced: 3 days ago
JSON representation
Includes; Sieve of Eratosthenes, Euler-Phi, etc...
- Host: GitHub
- URL: https://github.com/bh2smith/numbertheorypython
- Owner: bh2smith
- Created: 2015-12-01T20:44:12.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-01T20:51:45.000Z (over 10 years ago)
- Last Synced: 2025-09-13T11:04:22.408Z (10 months ago)
- Language: Python
- Homepage:
- Size: 1.95 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Number Theory in Python!
This python file includes
Classes:
- Sieve of Eratosthenes (up to $10^6$)
Functions:
- largestPrimeFactor
- factors
- numberOfFactors
- properDivisors
- sumDivisors
- eulerPhi
- order (of an integer modulo n)
- inverse (modulo n)
- lcm and gcd (lowest and greatest common divisors)
- egcd (similar to gcd but actually perfroms the Euclidean algorithm and returns all information)
- nCk (For binomial coefficients -- this is not an efficent algorithm)