Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Request to Contribute: Number Theory and Modular Arithmetic Helpers for CP #5

Closed
@Subhankar-Ray192

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /