login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 1

%I #13 May 23 2020 14:30:57

%S 1,1,1,1,3,2,11,9,1,53,44,9,309,265,66,3,2119,1854,530,44,16687,14833,

%T 4635,530,11,148329,133496,44499,6180,265,1468457,1334961,467236,

%U 74165,4635,53,16019531,14684570,5339844,934472,74165,1854,190899411

%N 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.

%C Row n has 1+floor(n/2) entries.

%C Sum of entries in row n is A002628(n).

%F T(n,k) = binomial(n-k,k)*(d(n-k) + d(n-k-1)), where d(j) = A000166(j) are the derangement numbers.

%F T(n,0) = d(n) + d(n-1) = A000255(n-1).

%F T(n,1) = d(n).

%F Sum_{k>=0} k*T(n,k) = A002629(n+1).

%e T(6,3)=3 because we have 125634, 341256, and 563412.

%e Triangle starts:

%e 1;

%e 1;

%e 1, 1;

%e 3, 2;

%e 11, 9, 1;

%e 53, 44, 9;

%e 309, 265, 66, 3;

%e 2119, 1854, 530, 44;

%p 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

%t d[0] = 1; d[n_] := d[n] = n d[n - 1] + (-1)^n;

%t T[n_, k_] := If[n == 0 && k == 0, 1, If[k <= n/2, Binomial[n - k, k] d[n + 1 - k]/(n - k), 0]];

%t Table[T[n, k], {n, 0, 20}, {k, 0, Quotient[n, 2]}] // Flatten (* _Jean-François Alcover_, May 23 2020 *)

%o (PARI) d(n) = if(n<2, !n , round(n!/exp(1)));

%o 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

%Y Cf. A000166, A002628, A002629, A000255.

%K nonn,tabf

%O 0,5

%A _Emeric Deutsch_, Sep 06 2010

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 18:05 EDT 2024. Contains 371798 sequences. (Running on oeis4.)