module Crystalg::NumberTheory

Defined in:

crystalg/number_theory/carmichael.cr
crystalg/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

Instance Method Detail

def carmichael(n) #

[View source]
def divisor(n) #

[View source]
def extgcd(a, b) #

returns {gcd(a,b), x, y} such that gcd(a,b) == ax + by


[View source]
def gcd(a, b) #

[View source]
def lcm(a, b) #

[View source]
def mobius(n) #

[View source]
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


[View source]
def phi_list(n) #

[View source]
def prime?(n) #

[View source]
def prime_factorize(n) #

[View source]
def sieve_of_eratosthenes(n) #

[View source]