login
Number of set partitions of [2n] having exactly n pairs (m,m+1) such that m is in some block b and m+1 is in block b+1.
2

%I #11 May 27 2018 06:50:41

%S 1,1,6,61,891,17081,404275,11364373,368982178,13564841773,

%T 556179920807,25136678260282,1240530238800284,66339010440041817,

%U 3819462133549622416,235473674234358044731,15472450628591543437233,1079168872840695090981865,79613621745613390178188361

%N Number of set partitions of [2n] having exactly n pairs (m,m+1) such that m is in some block b and m+1 is in block b+1.

%H Alois P. Heinz, <a href="/A271841/b271841.txt">Table of n, a(n) for n = 0..100</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Partition_of_a_set">Partition of a set</a>

%F a(n) = A185982(2n,n).

%p b:= proc(n, i, m, k) option remember; `if`(k>n, 0, `if`(n=0, 1,

%p add(`if`(j=i+1 and k=0, 0, b(n-1, j, max(m, j), k-

%p `if`(j=i+1, 1, 0))), j=1..m+1)))

%p end:

%p a:= n-> b(2*n, 1, 0, n):

%p seq(a(n), n=0..18);

%t b[n_, i_, m_, k_] := b[n, i, m, k] = If[k > n, 0, If[n == 0, 1, Sum[If[j == i + 1 && k == 0, 0, b[n - 1, j, Max[m, j], k - If[j == i + 1, 1, 0]]], {j, 1, m + 1}]]];

%t a[n_] := b[2*n, 1, 0, n];

%t Table[a[n], {n, 0, 18}] (* _Jean-François Alcover_, May 27 2018, translated from Maple *)

%Y Cf. A185982.

%K nonn

%O 0,3

%A _Alois P. Heinz_, Apr 15 2016