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.

A152887 Number of descents beginning with an even number and ending with an odd number in all permutations of {1,2,...,n}.

Original entry on oeis.org

0, 1, 2, 18, 72, 720, 4320, 50400, 403200, 5443200, 54432000, 838252800, 10059033600, 174356582400, 2440992153600, 47076277248000, 753220435968000, 16005934264320000, 288106816757760000, 6690480522485760000, 133809610449715200000, 3372002183332823040000
Offset: 1

Views

Author

Emeric Deutsch, Jan 19 2009

Keywords

Comments

a(n) is the number of ways to perform the following: Divide the set {1,2,...,n} into three pairwise disjoint subsets, A,B,C so that A union B union C = {1,2,...,n}. Let A contain an odd number of elements and B contain an even number of elements. Linearly order the elements within each subset. - Geoffrey Critzer, Sep 26 2011

Examples

			a(8) = 50400 because (i) the descent pairs can be chosen in 1+2+3+4 = 10 ways, namely (2,1), (4,1), (4,3), (6,1), (6,3), (6,5), (8,1), (8,3), (8,5), (8,7); (ii) they can be placed in 7 positions, namely (1,2), (2,3), (3,4), (4,5), (5,6), (6,7), (7,8); (iii) the remaining 6 entries can be permuted in 6! = 720 ways; 10*7*720 = 50400.
		

References

  • Miklos Bona, A Walk Through Combinatorics, World Scientific Publishing Co., 2002, page 170.

Crossrefs

Programs

  • Magma
    [Factorial(n-1)*(2*n*(n+1)+(2*n+1)*(-1)^n-1)/16: n in [1..20]]; // Bruno Berselli, Nov 07 2011
  • Maple
    a := proc (n) if `mod`(n, 2) = 0 then factorial(n-1)*binomial((1/2)*n+1, 2) else factorial(n-1)*binomial((1/2)*n+1/2, 2) end if end proc: seq(a(n), n = 1 .. 22);
  • Mathematica
    CoefficientList[Series[x/((1 - x) (1 - x^2)^2), {x, 0, 20}], x]* Table[n!, {n, 0, 20}] (* Geoffrey Critzer, Mar 03 2010 *)

Formula

a(2n) = (2n-1)!*C(n+1,2); a(2n+1) = (2n)!*C(n+1,2).
E.g.f.: x/((1-x^2)^2*(1-x)). - Geoffrey Critzer, Mar 03 2010
a(n) = (n-1)!*(2*n*(n+1)+(2*n+1)*(-1)^n-1)/16. - Bruno Berselli, Nov 07 2011
D-finite with recurrence a(n) -2*a(n-1) +(-n^2+2)*a(n-2) +n*(n-3)*a(n-3)=0. - R. J. Mathar, Jul 26 2022
Sum_{n>=2} 1/a(n) = 4*(CoshIntegral(1) - gamma - 1/e) + 2 = 4*(A099284 - A001620 - A068985) + 2. - Amiram Eldar, Jan 22 2023

A152886 Number of descents beginning and ending with an even number in all permutations of {1,2,...,n}.

Original entry on oeis.org

0, 0, 0, 6, 24, 360, 2160, 30240, 241920, 3628800, 36288000, 598752000, 7185024000, 130767436800, 1830744115200, 36614882304000, 585838116864000, 12804747411456000, 230485453406208000, 5474029518397440000, 109480590367948800000, 2810001819444019200000
Offset: 1

Views

Author

Emeric Deutsch, Jan 19 2009

Keywords

Examples

			a(7) = 2160 because (i) the descent pairs can be chosen in binomial(3,2) = 3 ways, namely (4,2), (6,2), (6,4); (ii) they can be placed in 6 positions, namely (1,2),(2,3),(3,4),(4,5),(5,6),(6,7); (iii) the remaining 5 entries can be permuted in 5! = 120 ways; 3*6*120 = 2160.
		

Crossrefs

Programs

  • Maple
    a := proc (n) if `mod`(n, 2) = 0 then factorial(n-1)*binomial((1/2)*n, 2) else factorial(n-1)*binomial((1/2)*n-1/2, 2) end if end proc: seq(a(n), n = 1 .. 22);
  • Mathematica
    a[n_] := (n - 1)! * Binomial[If[OddQ[n], (n - 1)/2, n/2], 2]; Array[a, 25] (* Amiram Eldar, Jan 22 2023 *)

Formula

a(2n) = (2n-1)!*binomial(n,2); a(2n+1) = (2n)!*binomial(n,2).
D-finite with recurrence +(-n+4)*a(n) +(n-1)*a(n-1) +(n-2)*(n-1)^2*a(n-2)=0. - R. J. Mathar, Jul 31 2022
Sum_{n>=4} 1/a(n) = 2*(CoshIntegral(1) - gamma - 3*e + 8) = 2*(A099284 - A001620 - 3 * A001113 + 8). - Amiram Eldar, Jan 22 2023
Showing 1-2 of 2 results.