OFFSET
1,3
COMMENTS
Consider a set of n labeled elements. Form all splittings into two subsets. Consider the resulting sets and perform the splittings on all their subsets and so on. a(n+1) = number of splittings of the n-set {1,2,3,...,n}.
E.g., a(4) = 7 because we have {abc}, {ab}{c}, {ac}{b}, {bc}{a}, {{a}{b}}{c}, {{a}{c}}{b}, {{b}{c}}{a}. The case for unlabeled elements is described by A137732. This structure is related to the Double Factorials A000142 for which the recurrence is a(n) = Sum_{k=1..n-1} C(n-1,k)*a(k)*a(n-k) with a(1)=1, a(2)=1.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..70
FORMULA
a(n) = Sum_{k=1..n-1} S2(n-1,k)*a(k)*a(n-k) with a(1)=1, where S2(n,k) denotes the Stirling numbers of the second kind.
EXAMPLE
{a}.
{ab}, {a}{b}.
{abc}, {ab}{c}, {ac}{b}, {bc}{a}, {{a}{b}}{c}, {{a}{c}}{b}, {{b}{c}}{a}.
{abcd}, {abc}{d}, {abd}{c}, {acd}{b}, {bcd}{a},
{{ab}{c}}{d}, {{ab}{d}}{c}, {{ac}{d}}{b}, {{bc}{d}}{a},
{{ac}{b}}{d}, {{ad}{b}}{c}, {{ad}{c}}{b}, {{bd}{c}}{a},
{{bc}{a}}{d}, {{bd}{a}}{c}, {{cd}{a}}{b}, {{cd}{b}}{a},
{{{a}{b}}{c}}{d}, {{{a}{b}}{d}}{c}, {{{a}{c}}{d}}{b}, {{{b}{c}}{d}}{a},
{{{a}{c}}{b}}{d}, {{{a}{d}}{b}}{c}, {{{a}{d}}{c}}{b}, {{{b}{d}}{c}}{a},
{{{b}{c}}{a}}{d}, {{{b}{d}}{a}}{c}, {{{c}{d}}{a}}{b}, {{{c}{d}}{b}}{a},
{{ab}{cd}}, {{ac}{bd}}, {{ad}{bc}},
{{{a}{b}}{cd}}, {{{a}{c}}{bd}}, {{{a}{d}}{bc}},
{{ab}{{c}{d}}}, {{ac}{{b}{d}}}, {{ad}{{b}{c}}},
{{{a}{b}}{{c}{d}}}, {{{a}{c}}{{b}{d}}}, {{{a}{d}}{{b}{c}}}.
MAPLE
A137731 := proc(n) option remember ; local k ; if n = 1 then 1; else add(combinat[stirling2](n-1, k)*procname(k)*procname(n-k), k=1..n-1) ; fi; end: for n from 1 to 20 do printf("%d, ", A137731(n)) ; od: # R. J. Mathar, Aug 25 2008
MATHEMATICA
a[1] = 1; a[n_] := a[n] = Sum[StirlingS2[n-1, k]*a[k]*a[n-k], {k, 1, n-1}]; Array[a, 20] (* Jean-François Alcover, May 18 2018 *)
PROG
(Python)
from functools import cache
from sympy.functions.combinatorial.numbers import stirling as S2
@cache
def a(n): return sum(S2(n-1, k)*a(k)*a(n-k) for k in range(1, n)) if n > 1 else 1
print([a(n) for n in range(1, 21)]) # Michael S. Branicky, May 05 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Thomas Wieder, Feb 09 2008
EXTENSIONS
Extended by R. J. Mathar, Aug 25 2008
STATUS
approved