A238349 Triangle T(n,k) read by rows: T(n,k) is the number of compositions of n with k parts p at position p (fixed points), n>=0, 0<=k<=n.
1, 0, 1, 1, 1, 0, 2, 1, 1, 0, 3, 4, 1, 0, 0, 6, 7, 3, 0, 0, 0, 11, 16, 4, 1, 0, 0, 0, 22, 29, 12, 1, 0, 0, 0, 0, 42, 60, 23, 3, 0, 0, 0, 0, 0, 82, 120, 47, 7, 0, 0, 0, 0, 0, 0, 161, 238, 100, 12, 1, 0, 0, 0, 0, 0, 0, 316, 479, 198, 30, 1, 0, 0, 0, 0, 0, 0, 0, 624, 956, 404, 61, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1235, 1910, 818, 126, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0
Examples
Triangle starts: 00: 1, 01: 0, 1, 02: 1, 1, 0, 03: 2, 1, 1, 0, 04: 3, 4, 1, 0, 0, 05: 6, 7, 3, 0, 0, 0, 06: 11, 16, 4, 1, 0, 0, 0, 07: 22, 29, 12, 1, 0, 0, 0, 0, 08: 42, 60, 23, 3, 0, 0, 0, 0, 0, 09: 82, 120, 47, 7, 0, 0, 0, 0, 0, 0, 10: 161, 238, 100, 12, 1, 0, 0, 0, 0, 0, 0, 11: 316, 479, 198, 30, 1, 0, 0, 0, 0, 0, 0, 0, 12: 624, 956, 404, 61, 3, 0, 0, 0, 0, 0, 0, 0, 0, 13: 1235, 1910, 818, 126, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14: 2449, 3817, 1652, 258, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15: 4864, 7633, 3319, 537, 30, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ... From _Gus Wiseman_, Apr 03 2022: (Start) Row n = 5 counts the following compositions (empty columns indicated by dots): (5) (14) (113) . . . (23) (32) (122) (41) (131) (1211) (212) (221) (311) (1112) (2111) (1121) (11111) (End)
References
- M. Archibald, A. Blecher and A. Knopfmacher, Fixed points in compositions and words, accepted by the Journal of Integer Sequences.
Links
- Joerg Arndt and Alois P. Heinz, Table of n, a(n) for n = 0..10010 (rows 0..140, flattened)
- M. Archibald, A. Blecher, and A. Knopfmacher, Fixed Points in Compositions and Words, J. Int. Seq., Vol. 23 (2020), Article 20.11.1.
Crossrefs
Row sums are A011782.
Columns k=0-10 give: A238351, A240736, A240737, A240738, A240739, A240740, A240741, A240742, A240743, A240744, A240745.
The version for permutations is A008290.
The version with all zeros removed is A238350.
The version for reversed partitions is A238352.
Below: comps = compositions, first = column k=0, stat = rank statistic.
Programs
-
Maple
b:= proc(n, i) option remember; `if`(n=0, 1, expand( add(b(n-j, i+1)*`if`(i=j, x, 1), j=1..n))) end: T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n, 1)): seq(T(n), n=0..15);
-
Mathematica
b[n_, i_] := b[n, i] = If[n == 0, 1, Expand[Sum[b[n-j, i+1]*If[i == j, x, 1], {j, 1, n}]]]; T[n_] := Function[{p}, Table[Coefficient[p, x, i], {i, 0, n}]][b[n, 1]]; Table[T[n], {n, 0, 15}] // Flatten (* Jean-François Alcover, Jan 06 2015, after Alois P. Heinz *) pq[y_]:=Length[Select[Range[Length[y]],#==y[[#]]&]]; Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],pq[#]==k&]],{n,0,9},{k,0,n}] (* Gus Wiseman, Apr 03 2022 *)
Comments