combinat.spad line 1 [edit on github]
The IntegerCombinatoricFunctions package provides some standard functions in combinatorics.
binomial(n, r)
returns the binomial coefficient C(n, r) = n!/(r! (n-r)!)
, where n >= r >= 0
. This is the number of combinations of n
objects taken r
at a time.
catalan(n)
returns the n
-th Catalan number
distinct_partition(n)
returns the number of partitions of the integer n
with distinct members. This is the number of ways that n
can be written as a sum of distinct positive integers. For n > 0
this is the same as number of ways that n
can be written as a sum of odd positive integers.
factorial(n)
returns n!
. this is the product of all integers between 1 and n
(inclusive). Note: 0!
is defined to be 1.
multinomial(n, [m1, m2, ..., mk])
returns the multinomial coefficient n!/(m1! m2! ... mk!)
.
partition(n)
returns the number of partitions of the integer n
. This is the number of distinct ways that n
can be written as a sum of positive integers.
permutation(n)
returns !P(n, r) = n!/(n-r)!
. This is the number of permutations of n
objects taken r
at a time.
stirling1(n, m)
returns the Stirling number of the first kind denoted S[n, m]
.
stirling2(n, m)
returns the Stirling number of the second kind denoted SS[n, m]
.