Functions primes()
and factorize()
cut-and-pasted from
Bill Venables's conf.design package, version 0.0-3. Function
primes(n)
returns a vector of all primes not exceeding
n
; function factorize(n)
returns an integer vector of
nondecreasing primes whose product is n
.
The others are multiplicative functions, defined in Hardy and
Wright:
Function divisor()
, also written
\(\sigma_k(n)\), is the divisor function defined on
p239. This gives the sum of the \(k^{\rm th}\) powers of all
the divisors of n
. Setting \(k=0\) corresponds to
\(d(n)\), which gives the number of divisors of n
.
Function mobius()
is the Moebius function (p234), giving zero
if n
has a repeated prime factor, and \((-1)^q\) where
\(n=p_1p_2\ldots p_q\) otherwise.
Function totient()
is Euler's totient function (p52), giving
the number of integers smaller than n
and relatively prime to
it.
Function liouville()
gives the Liouville function.