// output of ./demo/comb/descent-rgs-stats-demo.cc:
// Description:
//% Statistics for descent sequences.
//% A descent sequence is a sequence [d(1), d(2), ..., d(n)] where d(1)=0,
//%  d(k)>=0, and d(k) <= 1 + desc([d(1), d(2), ..., d(k-1)]) and desc(.)
//%  counts the number of descents of its argument.
//% Cf. the following OEIS sequences:
//% A225624: triangle, length-n descent sequences with k-1 descents.

arg 1: 5 == n  [Length of strings, n>=1]  default=5
arg 2: 1 == sq  [Select stats:
    0 ==> max element
    1 ==> number of descents
    2 ==> number of ascents
    3 ==> number of zeros - 1
    4 ==> number of maximal digits - 1
    6 ==> position of last occurrence of zero
    7 ==> position of first occurrence of the maximal value
    8 ==> position of last occurrence of the maximal value
   10 ==> number of odd values
   40 ==> number of flat steps
]  default=1
   1:    [ . . . . . ]   0
   2:    [ . . . . 1 ]   0
   3:    [ . . . 1 . ]   1
   4:    [ . . . 1 1 ]   0
   5:    [ . . 1 . . ]   1
   6:    [ . . 1 . 1 ]   1
   7:    [ . . 1 . 2 ]   1
   8:    [ . . 1 1 . ]   1
   9:    [ . . 1 1 1 ]   0
  10:    [ . 1 . . . ]   1
  11:    [ . 1 . . 1 ]   1
  12:    [ . 1 . . 2 ]   1
  13:    [ . 1 . 1 . ]   2
  14:    [ . 1 . 1 1 ]   1
  15:    [ . 1 . 1 2 ]   1
  16:    [ . 1 . 2 . ]   2
  17:    [ . 1 . 2 1 ]   2
  18:    [ . 1 . 2 2 ]   1
  19:    [ . 1 1 . . ]   1
  20:    [ . 1 1 . 1 ]   1
  21:    [ . 1 1 . 2 ]   1
  22:    [ . 1 1 1 . ]   1
  23:    [ . 1 1 1 1 ]   0
5, 15, 3, 0, 0, 0, 
 ct=23
