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 12 results. Next

A000165 Double factorial of even numbers: (2n)!! = 2^n*n!.

Original entry on oeis.org

1, 2, 8, 48, 384, 3840, 46080, 645120, 10321920, 185794560, 3715891200, 81749606400, 1961990553600, 51011754393600, 1428329123020800, 42849873690624000, 1371195958099968000, 46620662575398912000, 1678343852714360832000, 63777066403145711616000
Offset: 0

Views

Author

Keywords

Comments

a(n) is also the size of the automorphism group of the graph (edge graph) of the n-dimensional hypercube and also of the geometric automorphism group of the hypercube (the two groups are isomorphic). This group is an extension of an elementary Abelian group (C_2)^n by S_n. (C_2 is the cyclic group with two elements and S_n is the symmetric group.) - Avi Peretz (njk(AT)netvision.net.il), Feb 21 2001
Then a(n) appears in the power series: sqrt(1+sin(y)) = Sum_{n>=0} (-1)^floor(n/2)*y^(n)/a(n) and sqrt((1+cos(y))/2) = Sum_{n>=0} (-1)^n*y^(2n)/a(2n). - Benoit Cloitre, Feb 02 2002
Appears to be the BinomialMean transform of A001907. See A075271. - John W. Layman, Sep 28 2002
Number of n X n monomial matrices with entries 0, +-1.
Also number of linear signed orders.
Define a "downgrade" to be the permutation d which places the items of a permutation p in descending order. This note concerns those permutations that are equal to their double-downgrades. The number of permutations of order 2n having this property are equinumerous with those of order 2n+1. a(n) = number of double-downgrading permutations of order 2n and 2n+1. - Eugene McDonnell (eemcd(AT)mac.com), Oct 27 2003
a(n) = (Integral_{x=0..Pi/2} cos(x)^(2*n+1) dx) where the denominators are b(n) = (2*n)!/(n!*2^n). - Al Hakanson (hawkuu(AT)excite.com), Mar 02 2004
1 + (1/2)x - (1/8)x^2 - (1/48)x^3 + (1/384)x^4 + ... = sqrt(1+sin(x)).
a(n)*(-1)^n = coefficient of the leading term of the (n+1)-th derivative of arctan(x), see Hildebrand link. - Reinhard Zumkeller, Jan 14 2006
a(n) is the Pfaffian of the skew-symmetric 2n X 2n matrix whose (i,j) entry is j for iDavid Callan, Sep 25 2006
a(n) is the number of increasing plane trees with n+1 edges. (In a plane tree, each subtree of the root is an ordered tree but the subtrees of the root may be cyclically rotated.) Increasing means the vertices are labeled 0,1,2,...,n+1 and each child has a greater label than its parent. Cf. A001147 for increasing ordered trees, A000142 for increasing unordered trees and A000111 for increasing 0-1-2 trees. - David Callan, Dec 22 2006
Hamed Hatami and Pooya Hatami prove that this is an upper bound on the cardinality of any minimal dominating set in C_{2n+1}^n, the Cartesian product of n copies of the cycle of size 2n+1, where 2n+1 is a prime. - Jonathan Vos Post, Jan 03 2007
This sequence and (1,-2,0,0,0,0,...) form a reciprocal pair under the list partition transform and associated operations described in A133314. - Tom Copeland, Oct 29 2007
a(n) = number of permutations of the multiset {1,1,2,2,...,n,n,n+1,n+1} such that between the two occurrences of i, there is exactly one entry >i, for i=1,2,...,n. Example: a(2) = 8 counts 121323, 131232, 213123, 231213, 232131, 312132, 321312, 323121. Proof: There is always exactly one entry between the two 1s (when n>=1). Given a permutation p in A(n) (counted by a(n)), record the position i of the first 1, then delete both 1s and subtract 1 from every entry to get a permutation q in A(n-1). The mapping p -> (i,q) is a bijection from A(n) to the Cartesian product [1,2n] X A(n-1). - David Callan, Nov 29 2007
Row sums of A028338. - Paul Barry, Feb 07 2009
a(n) is the number of ways to seat n married couples in a row so that everyone is next to their spouse. Compare A007060. - Geoffrey Critzer, Mar 29 2009
From Gary W. Adamson, Apr 21 2009: (Start)
Equals (-1)^n * (1, 1, 2, 8, 48, ...) dot (1, -3, 5, -7, 9, ...).
Example: a(4) = 384 = (1, 1, 2, 8, 48) dot (1, -3, 5, -7, 9) = (1, -3, 10, -56, 432). (End)
exp(x/2) = Sum_{n>=0} x^n/a(n). - Jaume Oliver Lafont, Sep 07 2009
Assuming n starts at 0, a(n) appears to be the number of Gray codes on n bits. It certainly is the number of Gray codes on n bits isomorphic to the canonical one. Proof: There are 2^n different starting positions for each code. Also, each code has a particular pattern of bit positions that are flipped (for instance, 1 2 1 3 1 2 1 for n=3), and these bit position patterns can be permuted in n! ways. - D. J. Schreffler (ds1404(AT)txstate.edu), Jul 18 2010
E.g.f. of 0,1,2,8,... is x/(1-2x/(2-2x/(3-8x/(4-8x/(5-18x/(6-18x/(7-... (continued fraction). - Paul Barry, Jan 17 2011
Number of increasing 2-colored trees with choice of two colors for each edge. In general, if we replace 2 with k we get the number of increasing k-colored trees. For example, for k=3 we get the triple factorial numbers. - Wenjin Woan, May 31 2011
a(n) = row sums of triangle A193229. - Gary W. Adamson, Jul 18 2011
Also the number of permutations of 2n (or of 2n+1) that are equal to their reverse-complements. (See the Egge reference.) Note that the double-downgrade described in the preceding comment (McDonnell) is equivalent to the reverse-complement. - Justin M. Troyka, Aug 11 2011
The e.g.f. can be used to form a generator, [1/(1-2x)] d/dx, for A000108, so a(n) can be applied to A145271 to generate the Catalan numbers. - Tom Copeland, Oct 01 2011
The e.g.f. of 1/a(n) is BesselI(0,sqrt(2*x)). See Abramowitz-Stegun (reference and link under A008277), p. 375, 9.6.10. - Wolfdieter Lang, Jan 09 2012
a(n) = order of the largest imprimitive group of degree 2n with n systems of imprimitivity (see [Miller], p. 203). - L. Edson Jeffery, Feb 05 2012
Row sums of triangle A208057. - Gary W. Adamson, Feb 22 2012
a(n) is the number of ways to designate a subset of elements in each n-permutation. a(n) = A000142(n) + A001563(n) + A001804(n) + A001805(n) + A001806(n) + A001807(n) + A035038(n) * n!. - Geoffrey Critzer, Nov 08 2012
For n>1, a(n) is the order of the Coxeter groups (also called Weyl groups) of types B_n and C_n. - Tom Edgar, Nov 05 2013
For m>0, k*a(m-1) is the m-th cumulant of the chi-squared probability distribution for k degrees of freedom. - Stanislav Sykora, Jun 27 2014
a(n) with 0 prepended is the binomial transform of A120765. - Vladimir Reshetnikov, Oct 28 2015
Exponential self-convolution of A001147. - Vladimir Reshetnikov, Oct 08 2016
Also the order of the automorphism group of the n-ladder rung graph. - Eric W. Weisstein, Jul 22 2017
a(n) is the order of the group O_n(Z) = {A in M_n(Z): A*A^T = I_n}, the group of n X n orthogonal matrices over the integers. - Jianing Song, Mar 29 2021
a(n) is the number of ways to tile a (3n,3n)-benzel or a (3n+1,3n+2)-benzel using left stones and two kinds of bones; see Defant et al., below. - James Propp, Jul 22 2023
a(n) is the number of labeled histories for a labeled topology with the modified lodgepole shape and n+1 cherry nodes. - Noah A Rosenberg, Jan 16 2025

Examples

			The following permutations and their reversals are all of the permutations of order 5 having the double-downgrade property:
  0 1 2 3 4
  0 3 2 1 4
  1 0 2 4 3
  1 4 2 0 3
G.f. = 1 + 2*x + 8*x^2 + 48*x^3 + 384*x^4 + 3840*x^5 + 46080*x^6 + 645120*x^7 + ...
		

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000142 (n!), A001147 ((2n-1)!!), A032184 (2^n*(n-1)!).
This sequence gives the row sums in A060187, and (-1)^n*a(n) the alternating row sums in A039757.
Also row sums in A028338.
Column k=2 of A329070.

Programs

  • Haskell
    a000165 n = product [2, 4 .. 2 * n]  -- Reinhard Zumkeller, Mar 28 2015
    
  • Magma
    [2^n*Factorial(n): n in [0..35]]; // Vincenzo Librandi, Apr 22 2011
    
  • Magma
    I:=[2,8]; [1] cat [n le 2 select I[n]  else (3*n-1)*Self(n-1)-2*(n-1)^2*Self(n-2): n in [1..35] ]; // Vincenzo Librandi, Feb 19 2015
    
  • Maple
    A000165 := proc(n) option remember; if n <= 1 then 1 else n*A000165(n-2); fi; end;
    ZL:=[S, {a = Atom, b = Atom, S = Prod(X,Sequence(Prod(X,b))), X = Sequence(b,card >= 0)}, labelled]: seq(combstruct[count](ZL, size=n), n=0..17); # Zerinvary Lajos, Mar 26 2008
    G(x):=(1-2*x)^(-1): f[0]:=G(x): for n from 1 to 29 do f[n]:=diff(f[n-1],x) od: x:=0: seq(f[n],n=0..17); # Zerinvary Lajos, Apr 03 2009
    A000165 := proc(n) doublefactorial(2*n) ; end proc; seq(A000165(n),n=0..10) ; # R. J. Mathar, Oct 20 2009
  • Mathematica
    Table[(2 n)!!, {n, 30}] (* Vladimir Joseph Stephan Orlovsky, Dec 13 2008 *)
    (2 Range[0, 30])!! (* Harvey P. Dale, Jan 23 2015 *)
    RecurrenceTable[{a[n] == 2 n*a[n-1], a[0] == 1}, a, {n,0,30}] (* Ray Chandler, Jul 30 2015 *)
  • PARI
    a(n)=n!<Charles R Greathouse IV, Feb 11 2011
    
  • PARI
    {a(n) = prod( k=1, n, 2*k)}; /* Michael Somos, Jan 04 2013 */
    
  • Python
    from math import factorial
    def A000165(n): return factorial(n)<Chai Wah Wu, Jan 24 2023
    
  • SageMath
    [2^n*factorial(n) for n in range(31)] # G. C. Greubel, Jul 21 2024

Formula

E.g.f.: 1/(1-2*x).
a(n) = A001044(n)/A000142(n)*A000079(n) = Product_{i=0..n-1} (2*i+2) = 2^n*Pochhammer(1,n). - Daniel Dockery (peritus(AT)gmail.com), Jun 13 2003
D-finite with recurrence a(n) = 2*n * a(n-1), n>0, a(0)=1. - Paul Barry, Aug 26 2004
This is the binomial mean transform of A001907. See Spivey and Steil (2006). - Michael Z. Spivey (mspivey(AT)ups.edu), Feb 26 2006
a(n) = Integral_{x>=0} x^n*exp(-x/2)/2 dx. - Paul Barry, Jan 28 2008
G.f.: 1/(1-2x/(1-2x/(1-4x/(1-4x/(1-6x/(1-6x/(1-.... (continued fraction). - Paul Barry, Feb 07 2009
a(n) = A006882(2*n). - R. J. Mathar, Oct 20 2009
From Gary W. Adamson, Jul 18 2011: (Start)
a(n) = upper left term in M^n, M = a production matrix (twice Pascal's triangle deleting the first "2", with the rest zeros; cf. A028326):
2, 2, 0, 0, 0, 0, ...
2, 4, 2, 0, 0, 0, ...
2, 6, 6, 2, 0, 0, ...
2, 8, 12, 8, 2, 0, ...
2, 10, 20, 20, 10, 2, ...
... (End)
From Sergei N. Gladkovskii, Apr 11 2013, May 01 2013, May 24 2013, Sep 30 2013, Oct 27 2013: (Start)
Continued fractions:
G.f.: 1 + x*(Q(0) - 1)/(x+1) where Q(k) = 1 + (2*k+2)/(1-x/(x+1/Q(k+1))).
G.f.: 1/Q(0) where Q(k) = 1 + 2*k*x - 2*x*(k+1)/Q(k+1).
G.f.: G(0)/2 where G(k) = 1 + 1/(1 - x*(2*k+2)/(x*(2*k+2) + 1/G(k+1))).
G.f.: 1/Q(0) where Q(k) = 1 - x*(4*k+2) - 4*x^2*(k+1)^2/Q(k+1).
G.f.: R(0) where R(k) = 1 - x*(2*k+2)/(x*(2*k+2)-1/(1-x*(2*k+2)/(x*(2*k+2) -1/R(k+1)))). (End)
a(n) = (2n-2)*a(n-2) + (2n-1)*a(n-1), n>1. - Ivan N. Ianakiev, Aug 06 2013
From Peter Bala, Feb 18 2015: (Start)
Recurrence equation: a(n) = (3*n - 1)*a(n-1) - 2*(n - 1)^2*a(n-2) with a(1) = 2 and a(2) = 8.
The sequence b(n) = A068102(n) also satisfies this second-order recurrence. This leads to the generalized continued fraction expansion lim_{n -> oo} b(n)/a(n) = log(2) = 1/(2 - 2/(5 - 8/(8 - 18/(11 - ... - 2*(n - 1)^2/((3*n - 1) - ... ))))). (End)
From Amiram Eldar, Jun 25 2020: (Start)
Sum_{n>=0} 1/a(n) = sqrt(e) (A019774).
Sum_{n>=0} (-1)^n/a(n) = 1/sqrt(e) (A092605). (End)
Limit_{n->oo} a(n)^4 / (n * A134372(n)) = Pi. - Daniel Suteu, Apr 09 2022
a(n) = 1/([x^n] hypergeom([1], [1], x/2)). - Peter Luschny, Sep 13 2024
a(n) = Sum_{k=0..n} k!*(n-k)!*binomial(n,k)^2. - Ridouane Oudra, Jul 13 2025

A114938 Number of permutations of the multiset {1,1,2,2,...,n,n} with no two consecutive terms equal.

Original entry on oeis.org

1, 0, 2, 30, 864, 39480, 2631600, 241133760, 29083420800, 4467125013120, 851371260364800, 197158144895712000, 54528028997584665600, 17752366094818747392000, 6720318485119046923315200, 2927066537906697348594432000, 1453437879238150456164433920000
Offset: 0

Views

Author

Hugo Pfoertner, Jan 08 2006

Keywords

Comments

a(n) is also the number of (0,1)-matrices A=(a_ij) of size n X 2n such that each row has exactly two 1's and each column has exactly one 1 and with the restriction that no 1 stands on the line from a_11 to a_22. - Shanzhen Gao, Feb 24 2010
a(n) is the number of permutations of the multiset {1,1,2,2,...,n,n} with no fixed points. - Alexander Burstein, May 16 2020
Also the number of 2-uniform ordered set partitions of {1...2n} containing no two successive vertices in the same block. - Gus Wiseman, Jul 04 2020

Examples

			a(2) = 2 because there are two permutations of {1,1,2,2} avoiding equal consecutive terms: 1212 and 2121.
		

References

  • R. P. Stanley, Enumerative Combinatorics Volume I, Cambridge University Press, 1997. Chapter 2, Sieve Methods, Example 2.2.3, page 68.

Crossrefs

Cf. A114939 = preferred seating arrangements of n couples.
Cf. A007060 = arrangements of n couples with no adjacent spouses; A007060(n) = 2^n * A114938(n) (this sequence).
Cf. A278990 = number of loopless linear chord diagrams with n chords.
Cf. A000806 = Bessel polynomial y_n(-1).
The version for multisets with prescribed multiplicities is A335125.
The version for prime indices is A335452.
Anti-run compositions are counted by A003242.
Anti-run compositions are ranked by A333489.
Inseparable partitions are counted by A325535.
Inseparable partitions are ranked by A335448.
Separable partitions are counted by A325534.
Separable partitions are ranked by A335433.
Other sequences involving the multiset {1,1,2,2,...,n,n}: A001147, A007717, A020555, A094574, A316972.
Row n=2 of A322093.

Programs

  • Magma
    [1] cat [n le 2 select 2*(n-1) else n*(2*n-1)*Self(n-1) + (n-1)*n*Self(n-2): n in [1..20]]; // Vincenzo Librandi, Aug 10 2015
    
  • Mathematica
    Table[Sum[Binomial[n,i](2n-i)!/2^(n-i) (-1)^i,{i,0,n}],{n,0,20}]  (* Geoffrey Critzer, Jan 02 2013, and adapted to the extension by Stefano Spezia, Nov 15 2018 *)
    Table[Length[Select[Permutations[Join[Range[n],Range[n]]],!MatchQ[#,{_,x_,x_,_}]&]],{n,0,5}] (* Gus Wiseman, Jul 04 2020 *)
  • PARI
    A114938(n)=sum(k=0, n, binomial(n, k)*(-1)^(n-k)*(n+k)!/2^k);
    vector(20, n, A114938(n-1)) \\ Michel Marcus, Aug 10 2015
    
  • SageMath
    def A114938(n): return (-1)^n*sum(binomial(n,k)*factorial(n+k)//(-2)^k for k in range(n+1))
    [A114938(n) for n in range(31)] # G. C. Greubel, Sep 26 2023

Formula

a(n) = Sum_{k=0..n} ((binomial(n, k)*(-1)^(n-k)*(n+k)!)/2^k).
a(n) = (-1)^n * n! * A000806(n), n>0. - Vladeta Jovovic, Nov 19 2009
a(n) = n*(2*n-1)*a(n-1) + (n-1)*n*a(n-2). - Vaclav Kotesovec, Aug 07 2013
a(n) ~ 2^(n+1)*n^(2*n)*sqrt(Pi*n)/exp(2*n+1). - Vaclav Kotesovec, Aug 07 2013
a(n) = n! * A278990(n). - Alexander Burstein, May 16 2020
From G. C. Greubel, Sep 26 2023: (Start)
a(n) = (-1)^n * (i/e)*sqrt(2/Pi) * n! * BesselK(n+1/2, -1).
a(n) = [n! * (1/x) * p_{n+1}(x)]|A104548%20for%20p">{x= -1} (See A104548 for p{n}(x)).
E.g.f.: sqrt(Pi/(2*x)) * exp(-(1+x)^2/(2*x)) * erfi((1+x)/sqrt(2*x)).
Sum_{n >= 0} a(n)*x^n/(n!)^2 = exp(sqrt(1-2*x))/sqrt(1-2*x).
Sum_{n >= 0} a(n)*x^n/(n!*(n+1)!) = ( 1 - exp(-1 + sqrt(1-2*x)) )/x. (End)

Extensions

a(0)=1 prepended by Seiichi Manyama, Nov 15 2018

A129348 Number of (directed) Hamiltonian circuits in the cocktail party graph of order n.

Original entry on oeis.org

0, 2, 32, 1488, 112512, 12771840, 2036229120, 434469611520, 119619533537280, 41303040523960320, 17481826772405452800, 8902337068174698086400, 5370014079716477003366400, 3786918976243761421064601600, 3087031512410698159166482022400, 2880726660365605475506018320384000
Offset: 1

Views

Author

Eric W. Weisstein, Apr 10 2007

Keywords

Comments

Also, the number of ways (up to rotations) to seat n married couples at a circular table with no spouses next to each other. Cf. A007060, A193639. - Geoffrey Critzer, Feb 09 2014
The cocktail party graph may also be called the n-octahedron, n-orthoplex or n-dimensional cross polytope. - Andrew Howroyd, May 14 2017

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<3, n*(n-1),
         ((136*n^3-608*n^2+762*n-470) *a(n-1)
           +4*(n-2)*(14*n^2+29*n-193) *a(n-2)
           -80*(n-2)*(n-3)*(n-4) *a(n-3)) /(34*n-101))
        end:
    seq(a(n), n=0..20);  # Alois P. Heinz, Feb 09 2014
  • Mathematica
    Prepend[Table[Sum[(-1)^i Binomial[n, i] (2n - 1 - i)! 2^i, {i, 0, n}], {n, 2, 16}], 0] (* Geoffrey Critzer, Feb 09 2014 *)
    Table[Piecewise[{{(-1 + 2 n)! Hypergeometric1F1[-n, 1 - 2 n, -2],
        n > 1}}], {n, 16}] (* Eric W. Weisstein, Mar 29 2014 *)
  • PARI
    { A129348(n) = sum(m=0,n-1, sum(k=1,n-m, (-1)^k * binomial(n-1,m) * binomial(n-m-1,k-1) * 2^(k-1) * ([0,k-1,2*(n-m-k);1,k-2,2*(n-m-k);1,k-1,2*(n-m-k-1)]^(2*n))[1,1] ) + sum(k=0,n-m, (-1)^k * binomial(n-1,m) * binomial(n-m-1,k) * 2^(k-1) * ([0,k,2*(n-m-k-1);2,k-1,2*(n-m-k-1);2,k,2*(n-m-k-2)]^(2*n))[1,1] ) ) } \\ Max Alekseyev, Dec 22 2013

Formula

For n>=2, a(n) = Sum_{k=0..n} (-1)^k*binomial(n,k)*(2*n-1-k)!*2^k. - Geoffrey Critzer, Feb 09 2014
Recurrence (for n>=4): (2*n-3)*a(n) = 2*(n-1)*(4*n^2 - 8*n + 5)*a(n-1) + 4*(n-2)*(n-1)*(2*n-1)*a(n-2). - Vaclav Kotesovec, Feb 09 2014
a(n) ~ sqrt(Pi) * 2^(2*n) * n^(2*n-1/2) / exp(2*n+1). - Vaclav Kotesovec, Feb 09 2014
For n>=2, a(n) = (-1 + 2 n)! Hypergeometric1F1[-n, 1 - 2 n, -2]. - Eric W. Weisstein, Mar 29 2014
a(n) = A003435(n) / (2*n) = A003436(n) * (n-1)! * 2^(n-1). - Andrew Howroyd, May 14 2017

Extensions

Terms a(6) onward from Max Alekseyev, Nov 10 2007

A193624 Number of ways n triples can sit in a row without any siblings next to each other.

Original entry on oeis.org

1, 0, 72, 37584, 53529984, 152458744320, 766958183193600, 6236531290739312640, 76788695692068062330880, 1361934174627779827740180480, 33454092372947487842682293452800, 1102556254139040688616563751190528000
Offset: 0

Views

Author

Andrew Woods, Aug 01 2011

Keywords

Crossrefs

Programs

  • Magma
    B:=Binomial;
    f:= func< n,j | (&+[B(n,k)*B(2*k,j)*(-3)^(n+k-j): k in [Ceiling(j/2)..n]]) >;
    A193624:= func< n | (&+[Factorial(n+j)*f(n,j): j in [0..2*n]]) >;
    [A193624(n): n in [0..30]]; // G. C. Greubel, Sep 22 2023
    
  • Mathematica
    A193624[n_]:= Sum[(n+j)!*Binomial[n,k]*Binomial[2*k,j]*(-3)^(n+k-j), {j,0,2*n}, {k,Ceiling[j/2],n}];
    Array[A193624, 30, 0] (* G. C. Greubel, Sep 22 2023 *)
  • SageMath
    b=binomial;
    def f(j,n): return sum(b(n,k)*b(2*k,j)*(-3)^(n+k-j) for k in range((j//2),n+1))
    def A193624(n): return sum(factorial(n+j)*f(j,n) for j in range(2*n+1))
    [A193624(n) for n in range(31)] # G. C. Greubel, Sep 22 2023

Formula

Lim_{n -> oo} a(n) -> (3n)!*exp(-2).
a(n) = A190826(n) * 6^n * n! for n >= 1. - Nathaniel Johnston, Aug 01 2011
a(n) -3*(9*n^3-9*n^2+8*n+8)*a(n-1) +108*(n-1)*(n^2-11*n+16)*a(n-2) +3024*(n-1)*(n-2)^2*a(n-3) -5184*(n-1)*(n-2)*(n-3)*a(n-4) = 0. - R. J. Mathar, May 23 2014
a(n) = Sum_{j=0..2*n} Sum_{k=ceiling(j/2)..n} (n+j)! * binomial(2*k, j) * binomial(n, k) * (-3)^(n+k-j). - G. C. Greubel, Sep 22 2023

A177840 Consider the n pairs (1,2), ..., (2n-1,2n); a(n) is the number of permutations of [ 2n ] with no two fixed points for any pair.

Original entry on oeis.org

1, 1, 21, 653, 37577, 3434169, 457819549, 83900098309, 20238575173137, 6217167231292913, 2369809434953636261, 1097587512530348834301, 607119566298408076479961, 395312612701784187384578473, 299298318246814086742418737197, 260721599469397754183307347278709
Offset: 0

Views

Author

Paul Weisenhorn, May 14 2010

Keywords

Comments

Inverse binomial transform of (2n)!. - Peter Luschny, May 31 2014
Also, the number of permutations of [2n] with no two cycle (2i-1,2i) for any pair. The number of permutation where no such pair is exchanged or fixed pointwise is A116218. - Aaron Meyerowitz, Jul 22 2023

Examples

			a(2) = 21, because there are 4! = 24 permutations of [ 4 ], only 3 of them have pairs with 2 fixed points: [1,2,3,4], [1,2,4,3], [2,1,3,4].
a(3) = A(3,0) = 653, A(3,1) = 63, A(3,2) = 3, A(3,4) = 1, sum = 720 = 6!.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) option remember;
          `if`(n<2, 1-n, (n-1) *(f(n-1)+f(n-2)))
        end:
    a:= n-> add(binomial(n,j) *2^j *f(2*n-j), j=0..n):
    seq(a(n), n=0..20);  # Alois P. Heinz, Sep 06 2011
  • Mathematica
    f[n_] := f[n] = If[n<2, 1-n, (n-1)*(f[n-1]+f[n-2])]; a[n_] := Sum[Binomial[ n, j]*2^j*f[2*n-j], {j, 0, n}]; Table[a[n], {n, 1, 20}] (* Jean-François Alcover, Feb 25 2017, after Alois P. Heinz *)

Formula

a(n) = Sum_{j=0..n} C(n,j) * 2^j * f(2*n-j), where f(n) is the number of permutations of [n] with no fixed-points (A000166).
a(n) = A(n,0), with A(n,s) = number of permutations of [2n] with exactly s pairs with 2 fixed points:
A(n,s) = (n!/s!) * Sum_{j=0..n-s} 1/(j!*(n-s-j)!) * 2^j * f(2*(n-s)-j).
A(n,n) = 1, A(n,n-1) = n, A(n,n-2) = 21*n!/(2*(n-2)!).
Sum_{s=0..n} A(n,s) = (2*n)!.
a(n) = Sum_{j=0..n} C(n,j)*(2*n-2*j)!*(-1)^j. - Tani Akinari, Feb 01 2015
A(n,s) = Sum_{j=s..n} C(n,j)*C(j,s)*(2*n-2*j)!*(-1)^(j-s). - Tani Akinari, Feb 01 2015
From Peter Bala, Mar 07 2015: (Start)
a(n) = Integral_{x = 0..oo} (x^2 - 1)^n*exp(-x) dx.
For n >= 1, Integral_{x = 0..1} (x^2 - 1)^n*exp(x) dx = A007060(n)*e - a(n). Hence lim_{n->oo} a(n)/A007060(n) = e.
O.g.f. with a(0) := 1: Sum_{k >= 0} (2*k)!*x^k/(1 + x)^(k + 1) = 1 + x + 21*x^2 + 653*x^3 + ....
a(n) = 2*n*(2*n - 1)*a(n-1) + 4*n*(n - 1)*a(n-2) + (-1)^n, with initial conditions a(0) = 1, a(1) = 1.
Homogeneous recurrence: a(n) = (4*n^2 - 2*n - 1)*a(n-1) + 2*(n - 1)*(4*n - 3)*a(n-2) + 4*(n - 1)*(n - 2)*a(n-3), with initial conditions a(0) = 1, a(1) = 1 and a(2) = 21. Cf. A064570. (End)
a(n) ~ sqrt(Pi) * 2^(2*n+1) * n^(2*n + 1/2) / exp(2*n). - Vaclav Kotesovec, Mar 10 2015
a(n) = (2*n)!*hypergeom([],[1/2-n],1/4)+(-1)^n*(1-hypergeom([1],[1/2,n+1],1/4)). - Peter Luschny, Mar 15 2015

Extensions

b-file changed to a-file by N. J. A. Sloane, Oct 05 2010
Edited by Alois P. Heinz, Sep 06 2011
a(0)=1 prepended by Alois P. Heinz, Jul 23 2023

A193639 Triangle T(n,k) of ways n couples can sit in a row with exactly k of them together.

Original entry on oeis.org

1, 0, 2, 8, 8, 8, 240, 288, 144, 48, 13824, 15744, 8064, 2304, 384, 1263360, 1401600, 710400, 211200, 38400, 3840, 168422400, 183582720, 92620800, 28108800, 5529600, 691200, 46080, 30865121280, 33223034880, 16717639680, 5148057600, 1061222400, 149022720, 13547520, 645120
Offset: 0

Views

Author

Andrew Woods, Aug 01 2011

Keywords

Comments

Row n sums to (2*n)!.
Dot product of row n and (0,1,2,3,...n) is equal to (2*n)!, for n > 0.
Dot product of row n and (0,0,1,2,...n-1) is equal to T(n,0), for n > 0.

Examples

			Triangle begins:
  1
  0 2
  8 8 8
  240 288 144 48
  13824 15744 8064 2304 384
There are T(3, 2) = 144 ways to arrange three couples in a row so that exactly two of them are together.
		

Programs

  • Mathematica
    Table[Table[Sum[(-1)^k Binomial[n-i,k](2n-i-k)! 2^(k+i),{k,0,n-i}]*Binomial[n,i],{i,0,n}],{n,0,10}]//Grid (* Geoffrey Critzer, Apr 21 2014 *)

Formula

T(n, k) = 2*(2*n-k)*T(n-1, k-1) + ((2*n-1-k)*(2*n-2-k)+2*k)*T(n-1, k) + 2*(k+1)*(2*n-2-k)*T(n-1, k+1) + (k+2)*(k+1)*T(n-1, k+2).
T(n, n) = 2^n * n! = (2*n)!!.
T(n, k) = Sum_{i=k..n} (-1)^(i-k) * 2^i * (2*n-i)! * binomial(n, i) * binomial(i, k).
T(n, 0) = A007060(n).
T(n, n) = A000165(n).

A330266 Number of ways to shuffle a deck of 4n cards, with 4 cards in each of n ranks, so that adjacent cards have different ranks.

Original entry on oeis.org

1, 0, 1152, 15095808, 751480602624, 93995798935633920, 25111340235557122867200, 12742555660097789273088983040, 11259023892340311657074592904642560, 16205462460428776872054787528078739374080, 36051066700209244649349258741114804984663244800, 118807003903158552156678227915553602167323425243136000
Offset: 0

Views

Author

David Radcliffe, Dec 07 2019

Keywords

Examples

			a(13) = 3668033946384704437729512814619767610579526911188666362431432294400 is the number of ways to shuffle a standard 52-card deck of playing cards so that no two cards of the same rank are adjacent.
		

Crossrefs

Cf. A007060 (2n cards), A193624 (3n cards).

Programs

  • Mathematica
    Table[Integrate[(x^4 - 12x^3 + 36x^2 - 24x)^n *Exp[-x],{x,0,Infinity}],{n,0,10}] (* Stefano Spezia, Dec 09 2019 *)

Formula

a(n) = Integral_{x=0..oo} (x^4 - 12x^3 + 36x^2 - 24x)^n*exp(-x) dx.
a(n) = 24^n * A321633(n).
Conjecture: Limit_{n->oo} a(n)/(4n)! = 1/e^3. The conjecture is based on the observation of the asymptotic behavior of A007060 and A193624; it seems that it can be generalized in the following way. Let b(n) be the number of ways to shuffle a deck of k*n cards, with k cards in each of n ranks, so that adjacent cards have different ranks. Then, lim_{n->oo} b(n)/(kn)! = 1/e^(k-1); maybe we could prove it with the help of rook polynomials theory or in some other way. - Sergey Kirgizov, Sep 29 2023

A264801 Number of essentially different seating arrangements for 2n couples around a circular table with 4n seats such that no spouses are neighbors, the neighbors of each person have opposite gender and no person's neighbors belong to the same couple.

Original entry on oeis.org

0, 6, 2400, 6375600, 45927907200, 713518388352000, 21216194909362252800, 1105729617210350356224000, 94398452626533646953922560000, 12514511465855205467497303154688000, 2467490887755897725667792936979169280000, 698323914872709997998407130752506728284160000
Offset: 1

Views

Author

Hugo Pfoertner, Nov 25 2015

Keywords

Comments

This might be called the "maximum diversity" menage problem. Arrangements that differ only by rotation or reflection are excluded by the following conditions: Seat number 1 is assigned to person A. Seat number 2 can only be taken by a person of the same gender as A. The second condition forces an mmffmmff... pattern.

Examples

			a(1)=0 because with 2 couples it is impossible to satisfy all three conditions.
a(2)=6 because only the following arrangements are possible with 4 couples: ABdaCDbc, ABcaDCbd, ACdaBDcb, ACbaDBcd, ADcaBCdb, ADbaCBdc. This corresponds to the (2*2-1)! possibilities for persons B, C and D to choose a seat. After the positions of A, B, C and D are fixed, only A000183(2*2)=1 possibility remains to arrange their spouses a, b, c  and d.
		

Crossrefs

Programs

  • PARI
    a000183(N)={my(a0=[0,0,0,1,2,20],a=vector(N),
    f(x)=fibonacci(x-1)+fibonacci(x+1)+2;);
    if(N<7,a=a0[1..N],for(k=1,6,a[k]=a0[k]);
    for(n=7,N,a[n] = (-1)^n*(4*n+f(n)) +
     (n/(n-1))*((n+1)*a[n-1] + 2*(-1)^n*f(n-1))
      - ((2*n)/(n-2))*((n-3)*a[n-2] + (-1)^n*f(n-2))
      + (n/(n-3))*((n-5)*a[n-3] + 2*(-1)^(n-1)*f(n-3))
      + (n/(n-4))*(a[n-4] + (-1)^(n-1)*f(n-4))));a};
    a264901(limit)={my(a183=a000183(2*limit)); for(n=1,limit,print1((2*n-1)!*a183[2*n],", "))};
    a264901(12) \\ Hugo Pfoertner, Sep 05 2020

Formula

a(n) = (2*n-1)! * A000183(2*n).

A285850 Number of ways n couples can sit in a row such that exactly one couple sits next to each other.

Original entry on oeis.org

0, 2, 8, 288, 15744, 1401600, 183582720, 33223034880, 7939197665280, 2421184409763840, 917547530747904000, 422959572499916390400, 233037523912020826521600, 151234400024881955183001600, 114177664785555609793383628800, 99217287255932372662490234880000
Offset: 0

Views

Author

Max Alekseyev, Apr 28 2017

Keywords

Examples

			For n=2, if the two couples are (1,2) and (a,b), the a(2) = 8 solutions are a12b, a21b, b12a, b21a, 1ab2, 1ba2, 2ab1, 2ba1. - _N. J. A. Sloane_, Apr 28 2017
		

Crossrefs

Cf. A007060.

Programs

  • Maple
    f:= rectoproc({(12*x^3+84*x^2+192*x+144)*a(x+1)+(8*x^3+34*x^2-6*x-108)*a(x+2)+(-4*x^3-42*x^2-147*x-162)*a(x+3)+(x+3)*a(x+4), a(0) = 0, a(1) = 2, a(2) = 8, a(3) = 288},a(x),remember):
    map(f, [$0..50]); # Robert Israel, Apr 28 2017
  • Mathematica
    a007060[n_]:=Sum[(-1)^(n - k) Binomial[n, k] Subfactorial[2k], {k, 0, n}]; a[n_]:=If[n<1, 0, a007060[n] + 2n*a007060[n - 1]]; Table[a[n], {n, 0, 50}] (* Indranil Ghosh, Apr 28 2017 *)
  • Python
    from sympy import binomial, subfactorial
    def a007060(n): return sum([(-1)**(n - k)*binomial(n, k)*subfactorial(2*k) for k in range(n + 1)])
    def a(n): return 0 if n<1 else a007060(n) + 2*n*a007060(n - 1) # Indranil Ghosh, Apr 28 2017

Formula

For n>0, a(n) = A007060(n) + 2*n*A007060(n-1).
For n>1, a(n) = ( (4*n^2 - 8*n + 1)*a(n-1) + (2*n-2)*(2*n-1)*a(n-2) ) * 2*n/(2*n-3).
(12*n^3+84*n^2+192*n+144)*a(n+1)+(8*n^3+34*n^2-6*n-108)*a(n+2)+(-4*n^3-42*n^2-147*n-162)*a(n+3)+(n+3)*a(n+4) = 0. - Robert Israel, Apr 28 2017

A286038 Number of (undirected) paths in the n-cocktail party graph.

Original entry on oeis.org

0, 12, 396, 21672, 1918920, 250696980, 45304472052, 10816917169296, 3296928965854032, 1248938916843586140, 575559130836761023260, 317049200473798671358392, 205722831410326997504441496, 155295648728262284680608862692, 134934407215203512994225979686660
Offset: 1

Views

Author

Eric W. Weisstein, Jun 15 2017

Keywords

Crossrefs

Cf. A167987 (cycles), A007060 (Hamiltonian paths), A129348 (Hamiltonian cycles).

Programs

  • Mathematica
    a[n_] := (1/2)*(-2n - 1 + Sum[Sum[(-1)^j*2^j*(k - j)!*Binomial[n, j]* Binomial[2n - 2j, k - 2j], {k, 2j, 2n}], {j, 0, n}]);
    Array[a, 15] (* Jean-François Alcover, Oct 02 2017, after Andrew Howroyd *)
    Table[(Sum[(-2)^k Binomial[n, k] k! HypergeometricU[k + 1, 2 n + 2 - k, 1], {k, 0, n}] - 2 n - 1)/2, {n, 20}] // FunctionExpand (* Eric W. Weisstein, Oct 02 2017 *)
  • PARI
    a(n) = (-2*n-1 + sum(j=0,n, sum(k=2*j,2*n, (-1)^j*2^j*(k-j)! * binomial(n,j) * binomial(2*n-2*j, k-2*j))) )/2; \\ Andrew Howroyd, Jun 19 2017

Formula

a(n) = (1/2) * (-2*n - 1 + Sum_{j=0..n} Sum_{k=2*j..2*n} (-1)^j*2^j*(k-j)! * binomial(n,j) * binomial(2*n-2*j,k-2*j) ). - Andrew Howroyd, Jun 19 2017

Extensions

Terms a(7) and beyond from Andrew Howroyd, Jun 19 2017
Showing 1-10 of 12 results. Next