OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..70
EXAMPLE
a(3) = 18 because there are 18 one-element transitions among the set partitions of n=3 elements ([x,z,y,...] means element 1 belongs to set x, element 2 belongs to set z, element 3 belongs to set y):
[1, 1, 1] -> [1, 1, 2]; [1, 1, 1] -> [1, 2, 1]; [1, 1, 1] -> [1, 2, 2];
[1, 1, 2] -> [1, 1, 1]; [1, 1, 2] -> [1, 2, 1]; [1, 1, 2] -> [1, 2, 2];
[1, 1, 2] -> [1, 2, 3]; [1, 2, 1] -> [1, 1, 1]; [1, 2, 1] -> [1, 1, 2];
[1, 2, 1] -> [1, 2, 2]; [1, 2, 1] -> [1, 2, 3]; [1, 2, 2] -> [1, 1, 1];
[1, 2, 2] -> [1, 1, 2]; [1, 2, 2] -> [1, 2, 1]; [1, 2, 2] -> [1, 2, 3];
[1, 2, 3] -> [1, 1, 2]; [1, 2, 3] -> [1, 2, 1]; [1, 2, 3] -> [1, 2, 2];
MAPLE
a:= proc(m) local b, r;
b:= proc(n, i, p, l) local g, h, k;
if i=0 then if n=0 then g:= l[1]; h:= l[2]; k:= l[3]+g+h;
r:= r+p*(g*(g-1)/2+g*(k-g)+h*(1+2*(k-1))+(m-g-2*h)*k) fi
else b(n, i-1, p, `if`(i<3, [0, l[]], l));
seq(b(n-i*j, i-1, p*n!/(i!)^j/(n-i*j)!/j!,
`if`(i<3, [j, l[]], [l[]+j])), j=1..n/i)
fi
end;
r:=0; b(m, max(m, 2), 1, [0]); r
end:
seq(a(n), n=0..25); # Alois P. Heinz, Apr 13 2012
MATHEMATICA
a[m_] := Module[{b, r}, b[n_, i_, p_, l_List] := Module[{g, h, k}, If[i == 0, If[n == 0, g = l[[1]]; h = l[[2]]; k = l[[3]] + g + h; r = r + p(g(g - 1)/2 + g(k - g) + h(1 + 2(k - 1)) + (m - g - 2h)k)], b[n, i - 1, p, If[i < 3, Prepend[l, 0], l]]; Table[b[n - i j, i - 1, p n!/(i!)^j/(n - i j)!/j!, If[i < 3, Prepend[l, j], l + j]], {j, 1, n/i}]]]; r = 0; b[m, Max[m, 2], 1, {0}]; r];
a /@ Range[0, 25] (* Jean-François Alcover, Nov 18 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Thomas Wieder, Apr 25 2004
EXTENSIONS
a(6)-a(23) from Alois P. Heinz, Apr 12 2012
STATUS
approved