Giter Site home page Giter Site logo

pynumbers's Introduction

Python Number theory library

Algorithms:

  • Greatest common divisor: gdc(a, b)

    • complexity: O(log(min(a,b)))
    • memory: O(log(min(a,b)))
    • description: computes the greatest common divisor between a and b
  • Modular Exponentiation: modexp(base, power, mod)

    • complexity: O(log(power))
    • memory: O(log(power))
    • description: computes (base^power) % mod
  • Pell's Equation: pell_solutions(n, k)

    • complexity: O(n^(1/2) log n)
    • memory: O(k)
    • desciption: computes a list with the first k solutions of the Pell equation: x^2 - n(y^2) = 1
  • Eratosthenes' Sieve: sieve(n)

    • complexity: O(n (log log n))
    • memory: O(n)
    • description: sieve of eratosthenes to find primes less than n
  • Miller Rabin Primality Test: miller_rabin(n, k=10)

    • complexity: O(k*(log n)^3)
    • memory:
    • description: find primes less than n with 4^(-k) probability

pynumbers's People

Contributors

kunigami avatar

Stargazers

MD SLAUDDIN avatar Chris White avatar Tiago Chiaveri avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.