Arithmetic
gcd : U64, U64 -> U64
The greatest common divisor of two positive integers a
and b
is the largest integer that divides both a
and b
.
lcm : U64, U64 -> U64
The least common multiple of two positive integer a
and b
is the smallest positive integer that is a multiple of both a
and b
.
divides : I64, I64 -> Bool
An integer a
divides another integer b
if and only if there exists an integer c
such that a * c = b
divisors : U64 -> List U64
The positive divisors of a positive integer n
are all the positive numbers that divide n
with no remainder, including n
itself.
To get the divisors of n
excluding n
itself, see properDivisors
.
properDivisors : U64 -> List U64
The proper divisors of a positive integer n
are all the positive numbers that divide n
with no remainder, excluding n
itself.
To get the divisors of n
including n
itself, see divisors
.
isPrime : U64 -> Bool
primeFactors : U64 -> List U64
The prime factors of a positive integer n
are the prime numbers that divide n
exactly.
isPerfect : U64 -> Bool
A perfect number is a positive integer that is equal to the sum of its proper divisors, excluding itself.