// output of ./demo/comb/composition-nz-minc-demo.cc: // Description: //% Compositions of n into positive parts with first part c and //% each part <= f times its predecessor. //% For c=1 the same as: f-ary Huffman codes (canonical trees) with //% (f-1)*n+1 terminal nodes, a[k] is the number of internal nodes of depth k. //% Such compositions (for f=2) are treated in //% Henryk Minc: "A Problem in Partitions: Enumeration of Elements of a //% given Degree in the free commutative entropic cyclic Groupoid", //% Proceedings of the Edinburgh Mathematical Society (2), //% vol.11, no.4, pp.223-224, (November-1959). //% The compositions for f=2 are also called "Cayley compositions", see //% George E. Andrews, Peter Paule, Axel Riese, Volker Strehl: //% "MacMahon's Partition Analysis V: Bijections, Recursions, and Magic Squares", //% in: Algebraic Combinatorics and Applications, proceedings of Euroconference Alcoma 99, //% September 12-19, 1999, Goessweinstein, Germany, //% A. Betten, A. Kohnert, R. Laue, A. Wassermann eds., Springer-Verlag, pp.1-39, (2001). //% See also: //% Christian Elsholtz, Clemens Heuberger, Helmut Prodinger: //% "The number of Huffman codes, compact trees, and sums of unit fractions", //% arXiv:1108.5964 [math.CO], (30-August-2011). //% //% Cf. OEIS sequences: //% f=2: A002572 (c=1), A002573 (c=2), A002574 (c=3), //% A049284 (c=4), A049285 (c=5). //% c=1: A002572 (f=2), A176485 (f=3), A176503 (f=4), //% A194628 (f=5), A194629 (f=6), A194630 (f=7), //% A194631 (f=8), A194632 (f=9), A194633 (f=10). arg 1: 9 == n [compositions of n] default=9 arg 2: 1 == c [first part] default=1 arg 3: 2 == f [max. ratio of consecutive parts] default=2 0: [ . 1 1 1 1 1 1 1 1 2 ] [ 1 1 1 1 1 1 1 1 1 ] 1: [ . 1 1 1 1 1 1 . 4 . ] [ 1 1 1 1 1 1 1 2 ] 2: [ . 1 1 1 1 1 . 3 2 . ] [ 1 1 1 1 1 1 2 1 ] 3: [ . 1 1 1 1 . 3 1 2 . ] [ 1 1 1 1 1 2 1 1 ] 4: [ . 1 1 1 1 . 2 4 . . ] [ 1 1 1 1 1 2 2 ] 5: [ . 1 1 1 .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4 . . ] [ 1 2 1 1 1 1 2 ] 30: [ . . 3 1 1 . 3 2 . . ] [ 1 2 1 1 1 2 1 ] 31: [ . . 3 1 . 3 1 2 . . ] [ 1 2 1 1 2 1 1 ] 32: [ . . 3 1 . 2 4 . . . ] [ 1 2 1 1 2 2 ] 33: [ . . 3 . 3 1 1 2 . . ] [ 1 2 1 2 1 1 1 ] 34: [ . . 3 . 3 . 4 . . . ] [ 1 2 1 2 1 2 ] 35: [ . . 3 . 2 3 2 . . . ] [ 1 2 1 2 2 1 ] 36: [ . . 3 . 1 6 . . . . ] [ 1 2 1 2 3 ] 37: [ . . 2 3 1 1 1 2 . . ] [ 1 2 2 1 1 1 1 ] 38: [ . . 2 3 1 . 4 . . . ] [ 1 2 2 1 1 2 ] 39: [ . . 2 3 . 3 2 . . . ] [ 1 2 2 1 2 1 ] 40: [ . . 2 2 3 1 2 . . . ] [ 1 2 2 2 1 1 ] 41: [ . . 2 2 2 4 . . . . ] [ 1 2 2 2 2 ] 42: [ . . 2 1 5 2 . . . . ] [ 1 2 2 3 1 ] 43: [ . . 2 . 8 . . . . . ] [ 1 2 2 4 ] 44: [ . . 1 5 1 1 2 . . . ] [ 1 2 3 1 1 1 ] 45: [ . . 1 5 . 4 . . . . ] [ 1 2 3 1 2 ] 46: [ . . 1 4 3 2 . . . . ] [ 1 2 3 2 1 ] 47: [ . . 1 3 6 . . . . . ] [ 1 2 3 3 ] 48: [ . . . 7 1 2 . . . . ] [ 1 2 4 1 1 ] 49: [ . . . 6 4 . . . . . ] [ 1 2 4 2 ] ct=50