#prime #factorization #pure #collection #triplet

bubblemath

A collection of mathematical algorithms in pure Rust

3 releases

0.1.2 Apr 20, 2021
0.1.1 Apr 16, 2021
0.1.0 Apr 13, 2021

#1963 in Math

MIT license

24KB
410 lines

Bubblemath

A collection of mathematical algorithms in pure Rust

Contents

  • Number theory
    • Primality test (Baillie-PSW)
    • Integer factorization (Pollard's rho)
    • Next prime, n-th prime
    • Jacobi symbol
    • Divisor sigma function
    • Iterator over Pythagorean triplets
    • Modular inverse
    • Chinese remainder theorem for two moduli
    • Algorithm to find minimal x satisfying left <= a*x <= right (mod m)
  • Linear recurrence
    • n-th term calculation (faster than matrix exponentiation by squaring)
    • Berlekamp-Massey algorithm (identifying linear recurrence modulo prime)

lib.rs:

A collection of mathematical algorithms written in pure Rust.

Contents

  • Number theory
    • Primality test (Baillie-PSW)
    • Integer factorization (Pollard's rho)
    • Next prime, n-th prime
    • Jacobi symbol
    • Divisor sigma function
    • Iterator over Pythagorean triplets
    • Modular inverse
    • Chinese remainder theorem for two moduli
    • Algorithm to find minimal x satisfying left <= a*x <= right (mod m)
  • Linear recurrence
    • n-th term calculation (faster than matrix exponentiation by squaring)
    • Berlekamp-Massey algorithm (identifying linear recurrence modulo prime)

Dependencies

~1MB
~18K SLoC