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.

Showing 1-2 of 2 results.

A152664 Triangle read by rows: T(n,k) is the number of permutations of {1,2,...,n} for which k is the maximal number of initial even entries (0 <= k <= floor(n/2)).

Original entry on oeis.org

1, 1, 1, 4, 2, 12, 8, 4, 72, 36, 12, 360, 216, 108, 36, 2880, 1440, 576, 144, 20160, 11520, 5760, 2304, 576, 201600, 100800, 43200, 14400, 2880, 1814400, 1008000, 504000, 216000, 72000, 14400, 21772800, 10886400, 4838400, 1814400, 518400, 86400
Offset: 1

Views

Author

Emeric Deutsch, Dec 13 2008

Keywords

Comments

Sum of entries in row n is n! (A000142).
Row n has 1 + floor(n/2) entries.
T(n,0) = A052558(n-1).
Sum_{k=0..ceiling(n/2)} k*T(n,k) = A152665(n).

Examples

			T(3,0)=4 because we have 123, 132, 312 and 321.
T(4,2)=4 because we have 2413, 2431, 4213 and 4231.
Triangle starts:
    1;
    1,   1;
    4,   2;
   12,   8,   4;
   72,  36,  12;
  360, 216, 108,  36;
		

Crossrefs

Programs

  • Maple
    T := proc (n, k) if `mod`(n, 2) = 1 then factorial((1/2)*n-1/2)*factorial((1/2)*n+1/2)*binomial(n-k-1, (1/2)*n-1/2) else factorial((1/2)*n)^2*binomial(n-k-1, (1/2)*n-1) end if end proc: for n to 11 do seq(T(n, k), k = 0 .. floor((1/2)*n)) end do; # yields sequence in triangular form

Formula

T(2n+1,k) = n!(n+1)!binomial(2*n-k,n);
T(2n,k) = (n!)^2*binomial(2n-k-1,n-1).

A152663 Number of leading odd entries in all permutations of {1,2,...,n} (see example).

Original entry on oeis.org

1, 1, 6, 16, 120, 540, 5040, 32256, 362880, 3024000, 39916800, 410572800, 6227020800, 76281004800, 1307674368000, 18598035456000, 355687428096000, 5762136335155200, 121645100408832000, 2211729098342400000, 51090942171709440000, 1030334000462807040000
Offset: 1

Views

Author

Emeric Deutsch, Dec 13 2008

Keywords

Comments

a(n) = Sum_{k=0..ceiling(n/2)} k*A152662(n,k).

Examples

			a(3) = 6 because in the permutations 123, 132, 213, 231, 312, 321 we have 1+2+0+0+2+1 = 6 leading odd entries.
		

Crossrefs

Programs

  • Maple
    ao := proc (n) options operator, arrow; factorial(2*n+1) end proc: ae := proc (n) options operator, arrow: n*factorial(2*n)/(n+1) end proc: a := proc (n) if `mod`(n, 2) = 1 then ao((1/2)*n-1/2) else ae((1/2)*n) end if end proc: seq(a(n), n = 1 .. 20);
  • Mathematica
    a[n_] := If[OddQ[n], n!, n*n!/(n+2)];
    Table[a[n], {n, 1, 20}] (* Jean-François Alcover, Apr 02 2024 *)

Formula

a(2n+1) = (2n+1)!;
a(2n) = n(2n)!/(n+1).
D-finite with recurrence 2*(n+2)*a(n) +3*(-n-1)*a(n-1) -2*n*(n-1)*(n+1)*a(n-2) +(n-2)*(n-1)^2*a(n-3)=0. - R. J. Mathar, Jul 26 2022
Showing 1-2 of 2 results.