cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A333213 Triangle read by rows where T(n,k) is the number of compositions of n with k adjacent terms that are equal or increasing (weak ascents) n >= 0, 0 <= k <= n.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 2, 1, 1, 0, 2, 4, 1, 1, 0, 3, 6, 5, 1, 1, 0, 4, 10, 10, 6, 1, 1, 0, 5, 17, 20, 13, 7, 1, 1, 0, 6, 27, 38, 31, 16, 8, 1, 1, 0, 8, 40, 69, 67, 42, 19, 9, 1, 1, 0, 10, 58, 123, 132, 101, 54, 22, 10, 1, 1
Offset: 0

Views

Author

Gus Wiseman, Mar 14 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
Also the number of compositions of n with k + 1 maximal strictly decreasing subsequences.
Also the number of compositions of n with k adjacent terms that are equal or decreasing (weak descents).

Examples

			Triangle begins:
   1
   0   1
   0   1   1
   0   2   1   1
   0   2   4   1   1
   0   3   6   5   1   1
   0   4  10  10   6   1   1
   0   5  17  20  13   7   1   1
   0   6  27  38  31  16   8   1   1
   0   8  40  69  67  42  19   9   1   1
   0  10  58 123 132 101  54  22  10   1   1
   0  12  86 202 262 218 139  67  25  11   1   1
   0  15 121 332 484 467 324 182  81  28  12   1   1
Row n = 6 counts the following compositions:
  (6)    (15)    (114)   (1113)   (11112)  (111111)
  (42)   (24)    (123)   (1122)
  (51)   (33)    (222)   (11121)
  (321)  (132)   (1131)  (11211)
         (141)   (1212)  (12111)
         (213)   (1221)  (21111)
         (231)   (1311)
         (312)   (2112)
         (411)   (2211)
         (2121)  (3111)
		

Crossrefs

Compositions by length are A007318.
The case of reversed partitions (instead of compositions) is A008284.
The version counting equal adjacencies is A106356.
The case of partitions (instead of compositions) is A133121.
The version counting unequal adjacencies is A238279.
The strict/strong version is A238343.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],Length[Split[#,#1>#2&]]==k&]],{n,0,12},{k,0,n}]
  • PARI
    T(n)={my(M=matrix(n+1, n+1)); M[1,1]=x; for(n=1, n, for(k=1, n, M[1+n,1+k] = M[1+n,1+k-1] + x*M[1+n-k, 1+n-k] + (1-x)*M[1+n-k, 1+min(k-1, n-k)])); M[1,1]=1; vector(n+1, i, Vecrev(M[i,i]))}
    { my(A=T(12)); for(i=1, #A, print(A[i])) } \\ Andrew Howroyd, Jan 19 2023