Skip to content

AnupamGhosh/maths

Repository files navigation

maths

This package contains basic tasks in number theory

  • Prime factors of a number
  • All factors of a number
  • Sieve of Eratosthenes
  • Euler's totient function
    • Number of natural numbers up to n which are coprime to n
    • A−n mod X = (A−1 mod X)n mod X = (Aφ(X)−1 mod X)n mod X
    • Gauss proves that a regular n-gon can be constructed with straightedge and compass if φ(n) is a power of 2
    • summation of lcm & gcd
  • Lucas Theorem
    • Finds nCr mod m, where m is prime & n > m. Complexity O(m + logm n * log m)
  • Exponentiation by Squaring
    • fast computation of large positive integer powers of a number in O(log N)

Naive thoughts

About

This package contains basic tasks in number theory

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors