Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bell

Bell Numbers


Description

Generate Bell numbers.

Usage

bell(n)

Arguments

n

integer, asking for the n-th Bell number.

Details

Bell numbers, commonly denoted as B_n, are defined as the number of partitions of a set of n elements. They can easily be calculated recursively.

Bell numbers also appear as moments of probability distributions, for example B_n is the n-th momentum of the Poisson distribution with mean 1.

Value

A single integer, as long as n<=22.

Examples

sapply(0:10, bell)
#      1      1      2      5     15     52    203    877   4140  21147 115975

numbers

Number-Theoretic Functions

v0.8-1
GPL (>= 3)
Authors
Hans Werner Borchers
Initial release
2021-04-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.