A370384
Number of permutations of [n] having no substring [k,k+1,k+2,k+3,k+4,k+5].
Original entry on oeis.org
1, 1, 2, 6, 24, 120, 719, 5037, 40306, 362802, 3628296, 39913080, 478970641, 6226733531, 87175347936, 1307641346772, 20922387099240, 355682119243320, 6402298503373917, 121643960874649867, 2432883613692550316, 51090627024035616300, 1123995015882951892680
Offset: 0
A370392
Number of permutations of [n] whose longest block is of length 3. A block of a permutation is a maximal sequence of consecutive integers which appear in consecutive positions.
Original entry on oeis.org
0, 0, 0, 1, 2, 11, 63, 415, 3121, 26402, 248429, 2575936, 29198926, 359351878, 4773277246, 68078349863, 1037820312090, 16842621113247, 289946286959875, 5277826030457339, 101291053229162471, 2044252472193005928, 43283094591188747415, 959369370636209414390
Offset: 0
-
my(N=30, x='x+O('x^N)); concat([0, 0, 0], Vec(sum(k=0, N, k!*x^k*(((1-x^3)/(1-x^4))^k-((1-x^2)/(1-x^3))^k))))
A180185
Triangle read by rows: T(n,k) is the number of permutations of [n] having no 3-sequences and having k successions (0 <= k <= floor(n/2)); a succession of a permutation p is a position i such that p(i +1) - p(i) = 1.
Original entry on oeis.org
1, 1, 1, 1, 3, 2, 11, 9, 1, 53, 44, 9, 309, 265, 66, 3, 2119, 1854, 530, 44, 16687, 14833, 4635, 530, 11, 148329, 133496, 44499, 6180, 265, 1468457, 1334961, 467236, 74165, 4635, 53, 16019531, 14684570, 5339844, 934472, 74165, 1854, 190899411
Offset: 0
T(6,3)=3 because we have 125634, 341256, and 563412.
Triangle starts:
1;
1;
1, 1;
3, 2;
11, 9, 1;
53, 44, 9;
309, 265, 66, 3;
2119, 1854, 530, 44;
-
d[0] := 1: for n to 51 do d[n] := n*d[n-1]+(-1)^n end do: a := proc (n, k) if n = 0 and k = 0 then 1 elif k <= (1/2)*n then binomial(n-k, k)*d[n+1-k]/(n-k) else 0 end if end proc: for n from 0 to 12 do seq(a(n, k), k = 0 .. (1/2)*n) end do; # yields sequence in triangular form
-
d[0] = 1; d[n_] := d[n] = n d[n - 1] + (-1)^n;
T[n_, k_] := If[n == 0 && k == 0, 1, If[k <= n/2, Binomial[n - k, k] d[n + 1 - k]/(n - k), 0]];
Table[T[n, k], {n, 0, 20}, {k, 0, Quotient[n, 2]}] // Flatten (* Jean-François Alcover, May 23 2020 *)
-
d(n) = if(n<2, !n , round(n!/exp(1)));
for(n=0, 20, for(k=0, (n\2), print1(binomial(n - k, k)*(d(n - k) + d(n - k - 1)),", ");); print();) \\ Indranil Ghosh, Apr 12 2017
Comments