// output of ./demo/comb/composition-nz-minc-demo.cc:
// Description:
//% Compositions of n into positive parts with first part a1 and
//%   each part <= f times its predecessor.
//% For a1=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 (a1=1), A002573 (a1=2), A002574 (a1=3),
//%        A049284 (a1=4), A049285 (a1=5).
//% a1=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).
//% f=2 and a1=1..n: A002843.

arg 1: 8 == n  [compositions of n (n >= 1)]  default=8
arg 2: 1 == a1  [first part]  default=1
arg 3: 2 == f  [max. ratio of consecutive parts]  default=2
   0:  [ 1 1 1 1 1 1 1 1 ]
     1 == + 1/2 + 1/4 + 1/8 + 1/16 + 1/32 + 1/64 + 1/128 + 2/256
   1:  [ 1 1 1 1 1 1 2 ]
     1 == + 1/2 + 1/4 + 1/8 + 1/16 + 1/32 + 4/128
   2:  [ 1 1 1 1 1 2 1 ]
     1 == + 1/2 + 1/4 + 1/8 + 1/16 + 3/64 + 2/128
   3:  [ 1 1 1 1 2 1 1 ]
     1 == + 1/2 + 1/4 + 1/8 + 3/32 + 1/64 + 2/128
   4:  [ 1 1 1 1 2 2 ]
     1 == + 1/2 + 1/4 + 1/8 + 2/32 + 4/64
   5:  [ 1 1 1 2 1 1 1 ]
     1 == + 1/2 + 1/4 + 3/16 + 1/32 + 1/64 + 2/128
   6:  [ 1 1 1 2 1 2 ]
     1 == + 1/2 + 1/4 + 3/16 + 4/64
   7:  [ 1 1 1 2 2 1 ]
     1 == + 1/2 + 1/4 + 2/16 + 3/32 + 2/64
   8:  [ 1 1 1 2 3 ]
     1 == + 1/2 + 1/4 + 1/16 + 6/32
   9:  [ 1 1 2 1 1 1 1 ]
     1 == + 1/2 + 3/8 + 1/16 + 1/32 + 1/64 + 2/128
  10:  [ 1 1 2 1 1 2 ]
     1 == + 1/2 + 3/8 + 1/16 + 4/64
  11:  [ 1 1 2 1 2 1 ]
     1 == + 1/2 + 3/8 + 3/32 + 2/64
  12:  [ 1 1 2 2 1 1 ]
     1 == + 1/2 + 2/8 + 3/16 + 1/32 + 2/64
  13:  [ 1 1 2 2 2 ]
     1 == + 1/2 + 2/8 + 2/16 + 4/32
  14:  [ 1 1 2 3 1 ]
     1 == + 1/2 + 1/8 + 5/16 + 2/32
  15:  [ 1 1 2 4 ]
     1 == + 1/2 + 8/16
  16:  [ 1 2 1 1 1 1 1 ]
     1 == + 3/4 + 1/8 + 1/16 + 1/32 + 1/64 + 2/128
  17:  [ 1 2 1 1 1 2 ]
     1 == + 3/4 + 1/8 + 1/16 + 4/64
  18:  [ 1 2 1 1 2 1 ]
     1 == + 3/4 + 1/8 + 3/32 + 2/64
  19:  [ 1 2 1 2 1 1 ]
     1 == + 3/4 + 3/16 + 1/32 + 2/64
  20:  [ 1 2 1 2 2 ]
     1 == + 3/4 + 2/16 + 4/32
  21:  [ 1 2 2 1 1 1 ]
     1 == + 2/4 + 3/8 + 1/16 + 1/32 + 2/64
  22:  [ 1 2 2 1 2 ]
     1 == + 2/4 + 3/8 + 4/32
  23:  [ 1 2 2 2 1 ]
     1 == + 2/4 + 2/8 + 3/16 + 2/32
  24:  [ 1 2 2 3 ]
     1 == + 2/4 + 1/8 + 6/16
  25:  [ 1 2 3 1 1 ]
     1 == + 1/4 + 5/8 + 1/16 + 2/32
  26:  [ 1 2 3 2 ]
     1 == + 1/4 + 4/8 + 4/16
  27:  [ 1 2 4 1 ]
     1 == + 7/8 + 2/16
 ct=28
