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-10 of 14 results. Next

A077613 Number of adjacent pairs of form (even,odd) among all permutations of {1,2,...,n}. Also, number of adjacent pairs of form (odd,even).

Original entry on oeis.org

0, 1, 4, 24, 144, 1080, 8640, 80640, 806400, 9072000, 108864000, 1437004800, 20118067200, 305124019200, 4881984307200, 83691159552000, 1506440871936000, 28810681675776000, 576213633515520000, 12164510040883200000, 267619220899430400000, 6182004002776842240000
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Array[Floor[#/2] Ceiling[#/2] (# - 1)! &, 19] (* Michael De Vlieger, Aug 16 2017 *)
  • PARI
    a(n) = floor(n/2)*ceil(n/2)*(n-1)!; \\ Michel Marcus, Aug 29 2013

Formula

a(n) = floor(n/2)*ceiling(n/2)*(n-1)!. Proof: There are floor(n/2)*ceiling(n/2) pairs (r, s) with r even and s odd. For each pair, there are n-1 places it can occur in a permutation and (n-2)! possible arrangements of the other numbers.
a(n) = A002620(n) * A000142(n-1). - Michel Marcus, Aug 29 2013
Sum_{n>=2} 1/a(n) = 6*(CoshIntegral(1) - gamma) + 2/e - 1 = 6*(A099284 - A001620) + 2*A068985 - 1. - Amiram Eldar, Jan 22 2023

A052618 Expansion of e.g.f. 1/((1-x)^2*(1-x^2)).

Original entry on oeis.org

1, 2, 8, 36, 216, 1440, 11520, 100800, 1008000, 10886400, 130636800, 1676505600, 23471078400, 348713164800, 5579410636800, 94152554496000, 1694745980928000, 32011868528640000, 640237370572800000, 13380961044971520000, 294381142989373440000
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

Permanent of the n X n (0, 1)-matrix with (i, j)-th entry equal to 0 iff (i=1, j=n), (i=2, j=1), (i=3, j=n), (i=4, j=1), ... - Simone Severini, Oct 17 2004
a(n) is the number of runs of odd entries in all permutations of {1,2,...,n+1}. Example: a(2)=8 because in the permutations 123, 132, 213, 231, 312 and 321 we have a total of 2+1+1+1+1+2 runs of odd entries. - Emeric Deutsch, Dec 14 2008
a(n) is the number of permutations of [n+2] whose first place is even and last place is odd (or any equivalent definition with two separate places in a permutation). - Olivier Gérard, Nov 07 2011

Examples

			The a(2) = 8 permutations of [4] starting with an even number and ending with an odd number are: 2143, 2341, 2413, 2431, 4123, 4213, 4231, 4321.
		

Crossrefs

Programs

  • Maple
    spec := [S,{S=Prod(Sequence(Z),Sequence(Z),Sequence(Prod(Z,Z)))},labeled]: seq(combstruct[count](spec,size=n), n=0..20);
    a := proc (n) options operator, arrow: factorial(n)*floor((1/2)*n+1)*ceil((1/2)*n+1) end proc; seq(a(n), n = 0 .. 20); # Emeric Deutsch, Dec 14 2008
  • Mathematica
    With[{nn=20},CoefficientList[Series[1/((1-x)^2*(1-x^2)),{x,0,nn}],x] Range[ 0,nn]!] (* Harvey P. Dale, Jun 01 2019 *)

Formula

E.g.f.: -1/(-1+x)^2/(-1+x^2).
Recurrence: {a(0)=1, a(1)=2, (-n^2-5*n-4)*a(n)+a(n+2)-2*a(n+1)=0.}.
a(n) = (1/8*(-1)^(-n)+1/4*n^2+n+7/8)*n! for n>0.
From Emeric Deutsch, Dec 14 2008: (Start)
a(n) = n!*floor((n+2)/2)*ceiling((n+2)/2).
a(n) = Sum_{k>=1} (k*A152666(n+1,k)). (End)
a(n) = n!*A002620(n+2). - R. J. Mathar, Nov 27 2011
Sum_{n>=0} 1/a(n) = 4*(sinh(1) + gamma - CoshIntegral(1)) - 2 = 4*(A073742 + A001620 - A099284) - 2. - Amiram Eldar, Jan 22 2023

A077611 Number of adjacent pairs of form (odd,odd) among all permutations of {1,2,...,n}.

Original entry on oeis.org

0, 0, 4, 12, 144, 720, 8640, 60480, 806400, 7257600, 108864000, 1197504000, 20118067200, 261534873600, 4881984307200, 73229764608000, 1506440871936000, 25609494822912000, 576213633515520000, 10948059036794880000, 267619220899430400000, 5620003638888038400000
Offset: 1

Views

Author

Keywords

Comments

a(n) is also the number of permutations of [n+1] starting and ending with an even number. - Olivier Gérard, Nov 07 2011

Examples

			For n=4, the a(4) = 12 permutations of degree 5 starting and ending with an even number are 21354, 21534, 23154, 23514, 25134, 25314, 41352, 41532, 43152, 43512, 45132, 45312.
		

Crossrefs

Programs

  • Magma
    [Factorial(n-1)*(2*n*(n-1)-(2*n-1)*(-1)^n-1)/8 : n in [1..30]]; // Vincenzo Librandi, Nov 16 2011
  • Mathematica
    Table[Ceiling[n/2] Ceiling[n/2 - 1] (n - 1)!, {n, 22}] (* Michael De Vlieger, Aug 20 2017 *)

Formula

a(n) = ceiling(n/2)*ceiling(n/2-1)*(n-1)!. Proof: There are ceiling(n/2) * ceiling(n/2-1) pairs (r, s) with r and s odd and distinct. For each pair, there are n-1 places it can occur in a permutation and (n-2)! possible arrangements of the other numbers.
a(n) = (n-1)!*(2*n*(n-1)-(2*n-1)*(-1)^n-1)/8. - Bruno Berselli, Nov 07 2011
Sum_{n>=3} 1/a(n) = 4*(CoshIntegral(1) - gamma - sinh(1) + 1) = 4*(A099284 - A001620 - A073742 + 1). - Amiram Eldar, Jan 22 2023

A052591 Expansion of e.g.f. x/((1-x)(1-x^2)).

Original entry on oeis.org

0, 1, 2, 12, 48, 360, 2160, 20160, 161280, 1814400, 18144000, 239500800, 2874009600, 43589145600, 610248038400, 10461394944000, 167382319104000, 3201186852864000, 57621363351552000, 1216451004088320000, 24329020081766400000, 562000363888803840000
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

Stirling transform of 2*a(n) = [2,4,24,96,...] is A052841(n+1) = [2,6,38,270,...]. - Michael Somos, Mar 04 2004
a(n) is the number of even fixed points in all permutations of {1,2,...,n+1}. Example: a(2)=2 because we have 12'3, 132, 312, 213, 231, and 32'1, the even fixed points being marked. - Emeric Deutsch, Jul 18 2009

Crossrefs

Cf. A052558. - Emeric Deutsch, Jul 18 2009

Programs

  • Maple
    spec := [S,{S=Prod(Z,Sequence(Z),Sequence(Prod(Z,Z)))},labeled]: seq(combstruct[count](spec,size=n), n=0..20);
    G(x):=x/(1-x)/(1-x^2): f[0]:=G(x): for n from 1 to 19 do f[n]:=diff(f[n-1],x) od: x:=0: seq(f[n],n=0..19); # Zerinvary Lajos, Apr 03 2009
  • PARI
    a(n)=if(n<0,0,n!*polcoeff(x/(1-x)/(1-x^2)+x*O(x^n),n))

Formula

Recurrence: {a(1)=1, a(0)=0, (-n^3 - 5*n^2 - 8*n - 4)*a(n) + (-2-n)*a(n+1) + (n+1)*a(n+2) = 0}.
a(n) = ((1/4)*(-1)^(1-n) + (1/2)*n + 1/4)*n!.
E.g.f.: x/((1-x)*(1-x^2)).
From Emeric Deutsch, Jul 18 2009: (Start)
a(n) = (n+1)!/2 if n is odd; a(n) = n!*n/2 if n is even.
a(n) = (n+1)! - A052558(n). (End)
a(n) = n!*A008619(n-1), n > 1. - R. J. Mathar, Nov 27 2011
Sum_{n>=1} 1/a(n) = 2*(CoshIntegral(1) + cosh(1) - gamma - 1) = 2*(A099284 + A073743 - A001620 - 1). - Amiram Eldar, Jan 22 2023

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

A077612 Number of adjacent pairs of form (even,even) among all permutations of {1,2,...,n}.

Original entry on oeis.org

0, 0, 0, 12, 48, 720, 4320, 60480, 483840, 7257600, 72576000, 1197504000, 14370048000, 261534873600, 3661488230400, 73229764608000, 1171676233728000, 25609494822912000, 460970906812416000, 10948059036794880000, 218961180735897600000, 5620003638888038400000
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Floor[n/2]*Floor[n/2 - 1]*(n - 1)!; Array[a, 25] (* Amiram Eldar, Jan 22 2023 *)
  • PARI
    a(n) = n\2 * (n\2-1)*(n-1)! ; \\ Michel Marcus, Aug 29 2013

Formula

a(n) = floor(n/2)*floor(n/2-1)*(n-1)!. Proof: There are floor(n/2)*floor(n/2-1) pairs (r, s) with r and s even and distinct. For each pair, there are n-1 places it can occur in a permutation and (n-2)! possible arrangements of the other numbers.
a(n) = A110660(n+2) * A000142(n-1). - Michel Marcus, Aug 29 2013
Sum_{n>=4} 1/a(n) = CoshIntegral(1) - gamma - 3*e + 8 = A099284 - A001620 - 3*A001113 + 8. - Amiram Eldar, Jan 22 2023

A091032 Second column (k=3) of array A090438 ((4,2)-Stirling2) divided by 8.

Original entry on oeis.org

1, 60, 5040, 604800, 99792000, 21794572800, 6102480384000, 2134124568576000, 912338253066240000, 468333636574003200000, 284372184127734743040000, 201645730563302817792000000, 165147853331345007771648000000
Offset: 2

Views

Author

Wolfdieter Lang, Jan 23 2004

Keywords

Crossrefs

Cf. A002674 (first column of A090438), A091033 (third column), A090438.

Programs

  • Mathematica
    a[n_] := (n - 1)*(2*n)!/4!; Array[a, 13, 2] (* Amiram Eldar, Nov 03 2022 *)
  • PARI
    a(n) = (n-1)*(2*n)!/4!; \\ Amiram Eldar, Nov 03 2022

Formula

a(n) = A090438(n, 3)/8 = (n-1)*(2*n)!/4!
E.g.f.: (-3*hypergeom([1/2, 1], [], 4*x) + hypergeom([1, 3/2], [], 4*x) + 2)/(8*3!) (cf. A090438).
From Amiram Eldar, Nov 03 2022: (Start)
Sum_{n>=2} 1/a(n) = 60 - 24*Gamma - 24*cosh(1) + 24*CoshIntegral(1) - 24*sinh(1).
Sum_{n>=2} (-1)^n/a(n) = -12 + 24*gamma - 24*cos(1) - 24*CosIntegral(1) + 24*SinIntegral(1). (End)
a(n+1) = Sum_{j = 1..n} (-1)^(n+j) * j^(2*n+2) * binomial(2*n, n-j) (Campbell, Eq. 17). - Peter Bala, Mar 30 2025

A091033 Third column (k=4) of array A090438 ((4,2)-Stirling2).

Original entry on oeis.org

1, 180, 25200, 4233600, 898128000, 239740300800, 79332244992000, 32011868528640000, 15509750302126080000, 8898339094906060800000, 5971815866682429603840000, 4637851802955964809216000000
Offset: 2

Views

Author

Wolfdieter Lang, Jan 23 2004

Keywords

Crossrefs

Cf. A091032 (second column of A090438 divided by 8), A091034 (fourth column divided by 24), A000384, A090438.

Programs

  • Mathematica
    a[n_] := (n-1)*(2*n-3)*(2*n)!/4!; Array[a, 12, 2] (* Amiram Eldar, Nov 03 2022 *)
  • PARI
    a(n) = (n-1)*(2*n-3)*(2*n)!/4!; \\ Amiram Eldar, Nov 03 2022

Formula

a(n) = A090438(n, 4), n>=2.
a(n) = (n-1)*(2*n-3)*(2*n)!/4! = binomial(2*(n-1), 2)*(2*n)!/4! = A000384(n-1)*(2*n)!/4!, n>=2.
E.g.f.: (6*hypergeom([1/2, 1], [], 4*x) - 4*hypergeom([1, 3/2], [], 4*x) + hypergeom([3/2, 2], [], 4*x) -3)/4! (cf. A090438).
From Amiram Eldar, Nov 03 2022: (Start)
Sum_{n>=2} 1/a(n) = -20 + 24*Gamma - 16*CoshIntegral(1) + 16*sinh(1) + 8*SinhIntegral(1).
Sum_{n>=2} (-1)^n/a(n) = 4 - 24*gamma + 16*cos(1) + 24*CosIntegral(1) - 16*sin(1) + 8*SinIntegral(1). (End)

A091034 Fourth column (k=5) of array A090438 ((4,2)-Stirling2) divided by 24.

Original entry on oeis.org

1, 280, 70560, 19958400, 6659452800, 2644408166400, 1244905998336000, 689322235650048000, 444916954745303040000, 331767548149023866880000, 283424276847308960563200000, 275246422218908346286080000000
Offset: 3

Views

Author

Wolfdieter Lang, Jan 23 2004

Keywords

Crossrefs

Cf. A091033 (third column of A090438), A091035 (fifth column), A090438.

Programs

  • Mathematica
    a[n_] := (n - 1)*(n - 2)*(2*n - 3)*(2*n)!/(5!*(3!)^2); Array[a, 12, 3] (* Amiram Eldar, Nov 03 2022 *)
  • PARI
    a(n) = (n-1)*(n-2)*(2*n-3)*(2*n)!/(5!*(3!)^2); \\ Amiram Eldar, Nov 03 2022

Formula

a(n) = A090438(n, 5)/24, n>=3.
a(n) = (n-1)*(n-2)*(2*n-3)*(2*n)!/(5!*(3!)^2), n>=3.
E.g.f.: (Sum_{p=2..5} (((-1)^(p+1))*binomial(5, p)*hypergeom([(p-1)/2, p/2], [], 4*x)) + 4)/(5!*4!) (cf. A090438).
From Amiram Eldar, Nov 03 2022: (Start)
Sum_{n>=3} 1/a(n) = 2010 - 4680*Gamma + 1800*cosh(1) + 4680*CoshIntegral(1) - 2520*sinh(1) - 2880*SinhIntegral(1).
Sum_{n>=3} (-1)^(n+1)/a(n) = -2010 - 3960*gamma + 3240*cos(1) + 3960*CosIntegral(1) - 1800*sin(1) + 2880*SinIntegral(1). (End)

A091035 Fifth column (k=6) of array A090438 ((4,2)-Stirling2).

Original entry on oeis.org

1, 840, 352800, 139708800, 59935075200, 29088489830400, 16183777978368000, 10339833534750720000, 7563588230670151680000, 6303583414831453470720000, 5951909813793488171827200000, 6330667711034891964579840000000
Offset: 3

Views

Author

Wolfdieter Lang, Jan 23 2004

Keywords

Crossrefs

Cf. A091034 (fourth column of A090438 divided by 24), A091036 (sixth column divided by 48), A053134, A090438.

Programs

  • Mathematica
    Table[Binomial[2n-2,4] (2n)!/6!,{n,3,20}] (* Harvey P. Dale, Jun 07 2021 *)
  • PARI
    a(n) = binomial(2*n-2, 4)*(2*n)!/6!; \\ Amiram Eldar, Nov 03 2022

Formula

a(n) = A090438(n, 6), n>=3.
a(n) = binomial(2*n-2, 4)*(2*n)!/6! = A053134(n-3)*(2*n)!/6!, n>=3.
E.g.f.: (Sum_{p=2..6} (((-1)^p)*binomial(6, p)*hypergeom([(p-1)/2, p/2], [], 4*x)) - 5)/6! (cf. A090438).
From Amiram Eldar, Nov 03 2022: (Start)
Sum_{n>=3} 1/a(n) = -594 + 1800*Gamma - 1008*cosh(1) - 1800*CoshIntegral(1) + 912*sinh(1) + 1464*SinhIntegral(1).
Sum_{n>=3} (-1)^(n+1)/a(n) = 1554 + 1080*gamma - 1248*cos(1) - 1080*CosIntegral(1) + 240*sin(1) - 1416*SinIntegral(1). (End)
Showing 1-10 of 14 results. Next