The number of ways a set of n elements can be partitioned into nonempty subsets is called a Bell number and is denoted B_n (not to be confused with the Bernoulli number, which is also commonly denoted B_n). For example, there are five ways the numbers {1, 2, 3} can be partitioned: {{1}, {2}, {3}}, {{1, 2}, {3}}, {{1, 3}, {2}}, {{1}, {2, 3}}, and {{1, 2, 3}}, so B_3 = 5. B_0 = 1, and the first few Bell numbers for n = 1, 2, ... are 1, 2, 5, 15, 52, 203, 877, 4140, 21147, 115975, ... (OEIS A000110). The numbers of digits in B_10^n for n = 0, 1, ... are given by 1, 6, 116, 1928, 27665, ... (OEIS A113015). Bell numbers are implemented in the Wolfram Language as BellB[n].