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.

A161133 Triangle read by rows: T(n,k) is the number of permutations of {1,2,...,n} having exactly k odd fixed points (0 <= k <= ceiling(n/2)).

This page as a plain text file.
%I A161133 #14 Jul 02 2019 01:50:15
%S A161133 1,0,1,1,1,3,2,1,14,8,2,64,42,12,2,426,234,54,6,2790,1704,468,72,6,
%T A161133 24024,12864,3024,384,24,205056,120120,32160,5040,480,24,2170680,
%U A161133 1145400,272400,37200,3000,120,22852200,13024080,3436200,544800,55800
%N A161133 Triangle read by rows: T(n,k) is the number of permutations of {1,2,...,n} having exactly k odd fixed points (0 <= k <= ceiling(n/2)).
%C A161133 Row n contains 1 + ceiling(n/2) entries.
%C A161133 Sum of row n is n! = A000142(n).
%C A161133 T(n,0) = A161131(n).
%C A161133 Sum_{k>=0} k*T(n,k) = A052558(n-1).
%H A161133 Indranil Ghosh, <a href="/A161133/b161133.txt">Rows 0..100, flattened</a>
%F A161133 T(n,k) = binomial(ceiling(n/2), k)*Sum_{j=0..ceiling(n/2)-k} (-1)^j*(n-k-j)!*binomial(ceiling(n/2)-k, j).
%e A161133 T(3,0)=3 because we have 312, 231, 321; T(3,2)=1 because we have 123.
%e A161133 Triangle starts:
%e A161133     1;
%e A161133     0,   1;
%e A161133     1,   1;
%e A161133     3,   2,  1;
%e A161133    14,   8,  2;
%e A161133    64,  42, 12, 2;
%e A161133   426, 234, 54, 6;
%p A161133 T := proc (n, k) options operator, arrow: binomial(ceil((1/2)*n), k)*add((-1)^j*binomial(ceil((1/2)*n)-k, j)*factorial(n-k-j), j = 0 .. ceil((1/2)*n)-k) end proc: for n from 0 to 12 do seq(T(n, k), k = 0 .. ceil((1/2)*n)) end do; # yields sequence in triangular form
%t A161133 Flatten[Table[Binomial[Ceiling[n/2], k]*Sum[(-1)^j*(n - k - j)!*Binomial[Ceiling[n/2] - k, j], {j, 0, Ceiling[n/2] - k}],{n, 0, 11}, {k, 0, Ceiling[n/2]}]] (* _Indranil Ghosh_, Mar 08 2017 *)
%o A161133 (PARI) tabf(nn) = { for(n=0, nn, for(k = 0, ceil(n/2), print1(binomial(ceil(n/2), k) * sum(j=0, ceil(n/2) - k, (-1)^j*(n - k - j)! * binomial(ceil(n/2) - k, j)),", ");); print();); };
%o A161133 tabf(12); \\ _Indranil Ghosh_, Mar 08 2017
%Y A161133 Cf. A000142, A161131, A052558, A161134.
%K A161133 nonn,tabf
%O A161133 0,6
%A A161133 _Emeric Deutsch_, Jul 18 2009