module Crystalg::NumberTheory
Defined in:
crystalg/number_theory/carmichael.crcrystalg/number_theory/euclid.cr
crystalg/number_theory/euler_phi.cr
crystalg/number_theory/mobius.cr
crystalg/number_theory/mod.cr
crystalg/number_theory/prime_number.cr
crystalg/number_theory/stern_brocot_tree.cr
Instance Method Summary
- #carmichael(n)
- #divisor(n)
-
#extgcd(a, b)
returns {gcd(a,b), x, y} such that gcd(a,b) == ax + by
- #gcd(a, b)
- #lcm(a, b)
- #mobius(n)
-
#phi(n)
count the totatives of n that is the positive integers less than or equal to n that are relatively prime to n
- #phi_list(n)
- #prime?(n)
- #prime_factorize(n)
- #sieve_of_eratosthenes(n)
Instance Method Detail
def phi(n)
#
count the totatives of n that is the positive integers less than or equal to n that are relatively prime to n