A238130
Triangle read by rows: T(n,k) is the number of compositions into nonzero parts with k parts directly followed by a different part, n>=0, 0<=k<=n.
Original entry on oeis.org
1, 1, 0, 2, 0, 0, 2, 2, 0, 0, 3, 4, 1, 0, 0, 2, 10, 4, 0, 0, 0, 4, 12, 14, 2, 0, 0, 0, 2, 22, 29, 10, 1, 0, 0, 0, 4, 26, 56, 36, 6, 0, 0, 0, 0, 3, 34, 100, 86, 31, 2, 0, 0, 0, 0, 4, 44, 148, 200, 99, 16, 1, 0, 0, 0, 0, 2, 54, 230, 374, 278, 78, 8, 0, 0, 0, 0, 0, 6, 58, 322, 680, 654, 274, 52, 2, 0, 0, 0, 0, 0
Offset: 0
Triangle starts:
00: 1,
01: 1, 0,
02: 2, 0, 0,
03: 2, 2, 0, 0,
04: 3, 4, 1, 0, 0,
05: 2, 10, 4, 0, 0, 0,
06: 4, 12, 14, 2, 0, 0, 0,
07: 2, 22, 29, 10, 1, 0, 0, 0,
08: 4, 26, 56, 36, 6, 0, 0, 0, 0,
09: 3, 34, 100, 86, 31, 2, 0, 0, 0, 0,
10: 4, 44, 148, 200, 99, 16, 1, 0, 0, 0, 0,
11: 2, 54, 230, 374, 278, 78, 8, 0, 0, 0, 0, 0,
12: 6, 58, 322, 680, 654, 274, 52, 2, 0, 0, 0, 0, 0,
13: 2, 74, 446, 1122, 1390, 814, 225, 22, 1, 0, 0, 0, 0, 0,
...
Row 5 is [2, 10, 4, 0, 0, 0] because in the 16 compositions of 5
##: [composition] no. of changes
01: [ 1 1 1 1 1 ] 0
02: [ 1 1 1 2 ] 1
03: [ 1 1 2 1 ] 2
04: [ 1 1 3 ] 1
05: [ 1 2 1 1 ] 2
06: [ 1 2 2 ] 1
07: [ 1 3 1 ] 2
08: [ 1 4 ] 1
09: [ 2 1 1 1 ] 1
10: [ 2 1 2 ] 2
11: [ 2 2 1 ] 1
12: [ 2 3 ] 1
13: [ 3 1 1 ] 1
14: [ 3 2 ] 1
15: [ 4 1 ] 1
16: [ 5 ] 0
there are 2 with no changes, 10 with one change, and 4 with two changes.
Cf.
A238279 (same sequence with zeros omitted).
Cf.
A106356 (compositions with k successive parts same).
Cf.
A225084 (compositions with maximal up-step k).
-
b:= proc(n, v) option remember; `if`(n=0, 1, expand(
add(b(n-i, i)*`if`(v=0 or v=i, 1, x), i=1..n)))
end:
T:= n-> seq(coeff(b(n, 0), x, i), i=0..n):
seq(T(n), n=0..14);
-
b[n_, v_] := b[n, v] = If[n == 0, 1, Sum[b[n-i, i]*If[v == 0 || v == i, 1, x], {i, 1, n}]]; T[n_] := Table[Coefficient[b[n, 0], x, i], {i, 0, n}]; Table[T[n], {n, 0, 14}] // Flatten (* Jean-François Alcover, Jan 12 2015, translated from Maple *)
A059570
Number of fixed points in all 231-avoiding involutions in S_n.
Original entry on oeis.org
1, 2, 6, 14, 34, 78, 178, 398, 882, 1934, 4210, 9102, 19570, 41870, 89202, 189326, 400498, 844686, 1776754, 3728270, 7806066, 16311182, 34020466, 70837134, 147266674, 305718158, 633805938, 1312351118, 2714180722, 5607318414, 11572550770, 23860929422
Offset: 1
a(3) = 6 because in the 231-avoiding involutions of {1,2,3}, i.e., in 123, 132, 213, 321, we have altogether 6 fixed points (3+1+1+1).
- Vincenzo Librandi, Table of n, a(n) for n = 1..1000
- Roland Bacher, Chebyshev polynomials, quadratic surds and a variation of Pascal's triangle, arXiv:1509.09054 [math.CO], 2015.
- S. Heubach and T. Mansour, Counting rises, levels and drops in compositions, arXiv:math/0310197 [math.CO], 2003.
- Brian Hopkins, Andrew V. Sills, Thotsaporn "Aek" Thanatipanonda, and Hua Wang, Parts and subword patterns in compositions, Preprint 2015.
- Silvana Ramaj, New Results on Cyclic Compositions and Multicompositions, Master's Thesis, Georgia Southern Univ., 2021. See p. 30.
- Index entries for linear recurrences with constant coefficients, signature (3,0,-4).
-
[(3*n+4)*2^n/18-2*(-1)^n/9: n in [1..40]]; // Vincenzo Librandi, May 01 2017
-
LinearRecurrence[{3,0,-4},{1,2,6},30] (* Harvey P. Dale, Dec 29 2013 *)
Table[(3 n + 4) 2^n/18 - 2 (-1)^n/9, {n, 30}] (* Vincenzo Librandi, May 01 2017 *)
More terms from Eugene McDonnell (eemcd(AT)mac.com), Jan 13 2005
A224959
Number of compositions [p(1), p(2), ..., p(k)] of n such that p(j) - p(j-1) <= 2.
Original entry on oeis.org
1, 1, 2, 4, 8, 15, 29, 55, 105, 199, 378, 716, 1358, 2572, 4873, 9229, 17480, 33102, 62688, 118709, 224795, 425676, 806068, 1526371, 2890338, 5473125, 10363871, 19624925, 37161558, 70368705, 133249369, 252319408, 477788980, 904735349, 1713195705, 3244086145
Offset: 0
There are a(5) = 15 such compositions of 5:
01: [ 1 1 1 1 1 ]
02: [ 1 1 1 2 ]
03: [ 1 1 2 1 ]
04: [ 1 1 3 ]
05: [ 1 2 1 1 ]
06: [ 1 2 2 ]
07: [ 1 3 1 ]
08: [ 2 1 1 1 ]
09: [ 2 1 2 ]
10: [ 2 2 1 ]
11: [ 2 3 ]
12: [ 3 1 1 ]
13: [ 3 2 ]
14: [ 4 1 ]
15: [ 5 ]
(the single forbidden composition is [ 1 4 ]).
Cf.
A003116 (compositions such that p(j) - p(j-1) <= 1).
Cf.
A225084 (triangle: compositions of n such that max(p(j) - p(j-1)) = k).
Cf.
A225085 (triangle: compositions of n such that max(p(j) - p(j-1)) <= k).
-
b:= proc(n, i) option remember;
`if`(n=0, 1, add(b(n-j, max(1, j-2)), j=i..n))
end:
a:= n-> b(n, 1):
seq(a(n), n=0..40); # Alois P. Heinz, May 02 2013
-
b[n_, i_] := b[n, i] = If[n==0, 1, Sum[b[n-j, Max[1, j-2]], {j, i, n}]];
a[n_] := b[n, 1];
a /@ Range[0, 40] (* Jean-François Alcover, Dec 19 2020, after Alois P. Heinz *)
A225085
Triangle read by rows: T(n,k) is the number of compositions of n with maximal up-step <= k; n>=1, 0<=k
Original entry on oeis.org
1, 2, 2, 3, 4, 4, 5, 7, 8, 8, 7, 13, 15, 16, 16, 11, 23, 29, 31, 32, 32, 15, 41, 55, 61, 63, 64, 64, 22, 72, 105, 119, 125, 127, 128, 128, 30, 127, 199, 233, 247, 253, 255, 256, 256, 42, 222, 378, 455, 489, 503, 509, 511, 512, 512, 56, 388, 716, 889, 967, 1001, 1015, 1021, 1023, 1024, 1024
Offset: 1
Triangle begins
01: 1,
02: 2, 2,
03: 3, 4, 4,
04: 5, 7, 8, 8,
05: 7, 13, 15, 16, 16,
06: 11, 23, 29, 31, 32, 32,
07: 15, 41, 55, 61, 63, 64, 64,
08: 22, 72, 105, 119, 125, 127, 128, 128,
09: 30, 127, 199, 233, 247, 253, 255, 256, 256,
10: 42, 222, 378, 455, 489, 503, 509, 511, 512, 512,
...
The fifth row corresponds to the following statistics:
#: M composition
01: 0 [ 1 1 1 1 1 ]
02: 1 [ 1 1 1 2 ]
03: 1 [ 1 1 2 1 ]
04: 2 [ 1 1 3 ]
05: 1 [ 1 2 1 1 ]
06: 1 [ 1 2 2 ]
07: 2 [ 1 3 1 ]
08: 3 [ 1 4 ]
09: 0 [ 2 1 1 1 ]
10: 1 [ 2 1 2 ]
11: 0 [ 2 2 1 ]
12: 1 [ 2 3 ]
13: 0 [ 3 1 1 ]
14: 0 [ 3 2 ]
15: 0 [ 4 1 ]
16: 0 [ 5 ]
There are 7 compositions with no up-step (M<=0), 13 with M<=1, 15 with M<=2, 16 with M<=3, and 16 with M<=4.
Showing 1-4 of 4 results.
Comments