Learn R Programming

multicool (version 1.0.1)

Bell: Compute the Bell numbers

Description

This function computes the Bell numbers, which is the summ of Stirling numbers of the second kind, \(S(n, k)\), over \(k = 1,\ldots, n\), i.e. $$B_n = \sum_{k=1}^{n}S(n, k),n \ge 1$$

Usage

Bell(n)

B(n)

Value

An vector of Bell numbers

Arguments

n

A vector of one or more non-zero positive integers

Functions

  • B(): Compute the Bell numbers

Author

James Curran

References

https://en.wikipedia.org/wiki/Stirling_numbers_of_the_second_kind#Recurrence_relation

See Also

Stirling2

Examples

Run this code

## returns B(6)
Bell(6)

## returns B(1), B(2), ..., B(6)
B(1:6)

Run the code above in your browser using DataLab