-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Hello Maintainers,
I've been using this repository as part of my competitive programming workflow and have found it very helpful. I would like to ask if you are open to contributions focused on number theory and modular arithmetic utilities—tools that are commonly used in competitive programming but are not readily available or standardized in the Python ecosystem.
Proposed Contributions
If this direction aligns with the goals of the project, I would like to implement the following utilities step-by-step. Each would include clean and well-documented implementations, example usage, and optional test cases:
- ModInt wrapper class for safe and consistent modular arithmetic (similar to C++'s modint)
- Modular inverse functions using both Fermat’s Little Theorem and the Extended Euclidean Algorithm
- Efficient computation of binomial coefficients under modulo (nCr % mod)
- Sieve of Eratosthenes with smallest prime factor (SPF) support
- Miller-Rabin primality test (probabilistic, suitable for large inputs)
- Euler’s Totient Function and Möbius Function
The focus would be on clarity, reusability, and performance for CP-style applications.
If this proposal sounds useful, I would be happy to begin by submitting a pull request for the ModInt wrapper as a first step.
Thank you for your time and consideration. I look forward to your feedback.
Best regards,
Subhankar-Ray192