

A120672


a(n) = 2 * A285917(n) for n >=2, a(0) = a(1) = 0.


1



0, 0, 2, 12, 22, 60, 104, 252, 438, 1020, 1792, 4092, 7264, 16380, 29332, 65532, 118198, 262140, 475664, 1048572, 1912392, 4194300, 7683172, 16777212, 30850272, 67108860, 123817124, 268435452, 496754308, 1073741820, 1992366124, 4294967292, 7988854198
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,3


COMMENTS

Previous name was: Consider a set A containing at least n1 elements of sort "a" and a set B containing at least n1 elements of sort "b". From set A we take i elements, from set B we take (ni) elements such that i + (ni) = n. Then we distribute these n elements in two urns L (left) and R (right). The order of selection among the two sorts counts. Equivalently we can say: Then we form two sequences L and R from these n elements. The position of the sort of the elements within the sequences counts. Furthermore, the occupations of the urns are permuted. In other words, the order of the sequences L and R is swapped from LR to RL.
A028399(n) = 2*2^n  4 with n=1,2,3,... is an upper limit for a(n) because Sum_{i=1..n1} 2*n!/(i!*(ni)!) = 2*2^n  4. a(n) follows from all distinct ordered 2tuples of positive integers whose elements sum to n. See the first Maple program below.


LINKS

Table of n, a(n) for n=0..32.


FORMULA

For the number a(n) of such [LR] configurations we have a(n) = n!*Sum_{i=1..n1} delta2(i,ni)/(i!*(ni)!) where delta2(n,ni) = 2 if i <> (ni) and 1 if i = (ni).
a(n) = A028399(n)  A126869(n), n > 0.  R. J. Mathar, Aug 07 2008


EXAMPLE

For n=3 we have a(n=3)=12 configurations [LR] and [RL]: [aaab], [baaa], [baaa], [abaa], [abaa], [aaba], [aaba], [aaab] and [bbba], [abbb], [abbb], [babb], [babb], [bbab], [bbab], [bbba].


MAPLE

A120672 := proc(n::integer) local i, k, cmpstnlst, cmpstn, NumberOfParts, liste, NumberOfDifferentParts, Result; k:=2; Result := 0; cmpstnlst := composition(n, k); NumberOfParts := 0; NumberOfDifferentParts := 0; for i from 1 to nops(cmpstnlst) do cmpstn := cmpstnlst[i]; NumberOfParts := nops(cmpstn); if NumberOfParts > 0 then liste := convert(cmpstn, multiset); else liste := NULL; fi; if liste <> NULL then NumberOfDifferentParts := nops(liste); else NumberOfDifferentParts := 0; fi; Result := Result + n!/mul(op(j, cmpstn)!, j=1..NumberOfParts)*(NumberOfParts!/ mul(op(2, op(j, liste))!, j=1..NumberOfDifferentParts)); od; print(Result); end proc;
A120672 := proc(n) local i, Term, Result; Result:=0; for i from 1 to n1 do Term:=n!/(i!*(ni)!); if i <> ni then Term:=2*Term; fi; Result:=Result+Term; end do; print(Result); end proc;


CROSSREFS

Cf. A028399, A126869.
Sequence in context: A017293 A244188 A189330 * A190642 A108960 A111095
Adjacent sequences: A120669 A120670 A120671 * A120673 A120674 A120675


KEYWORD

nonn


AUTHOR

Thomas Wieder, Jun 24 2006


EXTENSIONS

Simpler name referring to A285917 from Joerg Arndt, Jun 25 2019


STATUS

approved



