[Next] [Prev] [Right] [Left] [Up] [Index] [Root]
Combinatorial Functions
Combinatorial Functions
Factorial(n) : RngIntElt -> RngIntElt
The factorial n! for non-negative small integer n.
NumberOfPermutations(n, k) : RngIntElt, RngIntElt -> RngIntElt
The number of permutations of n distinct objects taken k at a time.
Binomial(n, r) : RngIntElt, RngIntElt -> RngIntElt
The binomial coefficient n choose r.
Multinomial(n, [a_1, ... a_n]) : RngIntElt, [RngIntElt] -> RngIntElt
Given a sequence Q = [r_1, ..., r_k] of positive integers
such that n = r_1 + ... + r_k, return the multinomial
coefficient n choose r_1, ..., r_k.
Fibonacci(n) : RngIntElt -> RngIntElt
Given an integer n, this function returns the n-th Fibonacci
number F_n, which can be defined via the recursion F_0=0, F_1=1
and F_n=F_(n - 1) + F_(n - 2). Note that n is allowed to be negative,
and that F_n=( - 1)^(n - 1)F_(-n).
StirlingFirst(m, n) : RngIntElt, RngIntElt -> RngIntElt
The Stirling number of the first type, [(m atop n)],
where m and n are non-negative integers.
StirlingSecond(m, n) : RngIntElt, RngIntElt -> RngIntElt
The Stirling number of the second type, {(m atop n)},
where m and n are non-negative integers.
EulerianNumber(n, r) : RngIntElt, RngIntElt -> RngIntElt
The number E(n, r) of permutations p of {1, ..., n} having exactly
k ascents (i.e., places where p_i < p_(i + 1))
HarmonicNumber(n) : RngIntElt -> RngIntElt
The nth harmonic number H_n = Sigma_(i=1)^n (1/i).
BernoulliNumber(n) : RngIntElt -> RngIntElt
Returns the nth Bernoulli number B_n as a rational number.
BernoulliApproximation(n) : RngIntElt -> FldPrElt
Returns a real approximation to the nth Bernoulli number B_n.
BernoulliPolynomial(n) : RngIntElt -> RngUPolElt
The nth Bernoulli polynomial
B_n(x) = sum_(k=0)^n (n choose k) B_k x^(n - k) where B_n is the nth
Bernoulli number.
[Next] [Prev] [Right] [Left] [Up] [Index] [Root]