combinat::bell – Bell numbers

combinat::bell(n) computes the n-th Bell number.

→ Examples

Calls:

combinat::bell(n)

combinat::bell(expression)

Parameters:

n

nonnegative integer

expression

An expression of type Type::Arithmetical which must be a nonnegative integer if it is a number.

Return Value:

A positive integer value if n was a nonnegative integer. Otherwise combinat::bell returns the unevaluated function call.

Details:

Example 1:

The third Bell number is math:

combinat::bell(3)

math

This means that you can partition the set math into disjoint subsets in math different ways. These are mathmathmathmath, and math. Or, that you can write math as math different products. These are math.

Example 2:

If one uses a wrong argument, an error message is returned.

combinat::bell(3.4)

Error: Nonnegative integer expected [combinat::bell]

 

Example 3:

It can be useful to return the unevaluated function call.

a := combinat::bell(x);

x := 4;

a ;

delete(a);

math

math

math