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-3 of 3 results.

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

Original entry on oeis.org

0, 0, 2, 6, 72, 360, 4320, 30240, 403200, 3628800, 54432000, 598752000, 10059033600, 130767436800, 2440992153600, 36614882304000, 753220435968000, 12804747411456000, 288106816757760000, 5474029518397440000, 133809610449715200000, 2810001819444019200000
Offset: 1

Views

Author

Emeric Deutsch, Jan 19 2009

Keywords

Comments

a(n) is also number of descents beginning with an odd number and ending with an even number in all permutations of {1,2,...,n}. Example: a(4)=6; indeed for n=4 the only descent to be counted is 32, occurring only in 1324, 1432, 4132, 3214, 3241 and 4321.

Examples

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

Crossrefs

Programs

  • Maple
    a := proc (n) if `mod`(n, 2) = 0 then (1/4)*factorial(n)*((1/2)*n-1) else (1/8)*(n-1)*(n+1)*factorial(n-1) end if end proc: seq(a(n), n = 1 .. 20);
  • 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+1,2).
D-finite with recurrence (-n+3)*a(n) +(n-1)*a(n-1) +n*(n-1)*(n-2)*a(n-2)=0. - R. J. Mathar, Jul 26 2022
Sum_{n>=3} 1/a(n) = 8*(CoshIntegral(1) - gamma - sinh(1) + 1) = 8*(A099284 - A001620 - A073742 + 1). - 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

A199495 Number of permutations of [n] starting and ending with an odd number.

Original entry on oeis.org

0, 1, 0, 2, 4, 36, 144, 1440, 8640, 100800, 806400, 10886400, 108864000, 1676505600, 20118067200, 348713164800, 4881984307200, 94152554496000, 1506440871936000, 32011868528640000, 576213633515520000, 13380961044971520000, 267619220899430400000
Offset: 0

Views

Author

Olivier Gérard, Nov 07 2011

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> `if`(n<2, n, ceil(n/2)*(ceil(n/2)-1)*(n-2)!):
    seq(a(n), n=0..30); # Alois P. Heinz, Nov 07 2011

Formula

From Alois P. Heinz, Nov 07 2011: (Start)
a(n) = 2*(n-2)! * [x^(n-2)] x/((1+x)^2*(1-x)^3) for n>=2, else a(n) = n.
a(n) = 2*A152887(n-2) for n>=2, else a(n) = n. (End)
Showing 1-3 of 3 results.