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

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 *)
    A114938[n_] := ((2 n)! Hypergeometric1F1[-n, -2 n, -2]) / 2^n;
    Array[A114938, 17, 0]  (* Peter Luschny, Sep 04 2025 *)
  • 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)
a(n) = ((2*n)!/2^n) * hypergeom([-n], [-2*n], -2]) = A007060(n) / 2^n. - Peter Luschny, Sep 04 2025

Extensions

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

A322013 Square array A(n,k), n >= 1, k >= 1, read by antidiagonals, where A(n,k) is the number of permutations of n copies of 1..k introduced in order 1..k with no element equal to another within a distance of 1.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 5, 1, 0, 1, 36, 29, 1, 0, 1, 329, 1721, 182, 1, 0, 1, 3655, 163386, 94376, 1198, 1, 0, 1, 47844, 22831355, 98371884, 5609649, 8142, 1, 0, 1, 721315, 4420321081, 182502973885, 66218360625, 351574834, 56620, 1, 0
Offset: 1

Views

Author

Seiichi Manyama, Nov 24 2018

Keywords

Examples

			Square array begins:
   1, 1,     1,         1,              1,                    1, ...
   0, 1,     5,        36,            329,                 3655, ...
   0, 1,    29,      1721,         163386,             22831355, ...
   0, 1,   182,     94376,       98371884,         182502973885, ...
   0, 1,  1198,   5609649,    66218360625,     1681287695542855, ...
   0, 1,  8142, 351574834, 47940557125969, 16985819072511102549, ...
		

Crossrefs

Main diagonal gives A321666.

Programs

  • PARI
    q(n,x) = sum(i=1, n, (-1)^(n-i) * binomial(n-1, n-i) * x^i/i!)
    T(n,k) = subst(serlaplace(q(n,x)^k), x, 1)/k! \\ Andrew Howroyd, Feb 03 2024

Formula

T(n,k) = A322093(n,k) / k!. - Andrew Howroyd, Feb 03 2024

A322127 Triangular array, read by rows: T(n,k) = numerator of binomial(n-1, n-k)/k!, 1 <= k <= n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 1, 5, 5, 5, 1, 1, 1, 3, 5, 5, 1, 1, 1, 1, 7, 7, 35, 7, 7, 1, 1, 1, 4, 14, 7, 7, 7, 1, 1, 1, 1, 9, 6, 7, 21, 7, 1, 1, 1, 1, 1, 5, 15, 5, 7, 7, 1, 1, 1, 1, 1, 1, 11, 55, 55, 11, 77, 11, 11, 11, 11, 1, 1, 1, 6, 11, 55, 33, 11, 11, 11, 11, 11, 1, 1, 1
Offset: 1

Views

Author

Seiichi Manyama, Nov 27 2018

Keywords

Examples

			T(n,k) = binomial(n-1, n-k)/k!.
1/1;
1/1, 1/2;
1/1, 1/1, 1/6;
1/1, 3/2, 1/2,  1/24;
1/1, 2/1, 1/1,   1/6, 1/120;
1/1, 5/2, 5/3,  5/12,  1/24, 1/720;
1/1, 3/1, 5/2,   5/6,   1/8, 1/120, 1/5040;
1/1, 7/2, 7/2, 35/24,  7/24, 7/240,  1/720, 1/40320;
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := Numerator[Binomial[n-1, n-k]/k!]; Table[T[n, k], {n,1,10}, {k,1,n}] // Flatten (* Amiram Eldar, Nov 27 2018 *)

A322128 Triangular array, read by rows: T(n,k) = denominator of binomial(n-1, n-k)/k!, 1 <= k <= n.

Original entry on oeis.org

1, 1, 2, 1, 1, 6, 1, 2, 2, 24, 1, 1, 1, 6, 120, 1, 2, 3, 12, 24, 720, 1, 1, 2, 6, 8, 120, 5040, 1, 2, 2, 24, 24, 240, 720, 40320, 1, 1, 3, 3, 12, 90, 180, 5040, 362880, 1, 2, 1, 2, 20, 40, 60, 1120, 40320, 3628800, 1, 1, 2, 1, 4, 20, 24, 336, 8064, 362880, 39916800
Offset: 1

Views

Author

Seiichi Manyama, Nov 27 2018

Keywords

Examples

			See A322127.
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := Denominator[Binomial[n-1, n-k]/k!]; Table[T[n, k], {n,1,10}, {k,1,n}] // Flatten (* Amiram Eldar, Nov 27 2018 *)

A369923 Array read by antidiagonals: A(n,k) is the number of permutations of n copies of 1..k with values introduced in order and without cyclically adjacent elements equal.

Original entry on oeis.org

0, 1, 0, 1, 1, 0, 1, 4, 1, 0, 1, 31, 22, 1, 0, 1, 293, 1415, 134, 1, 0, 1, 3326, 140343, 75843, 866, 1, 0, 1, 44189, 20167651, 83002866, 4446741, 5812, 1, 0, 1, 673471, 3980871156, 158861646466, 55279816356, 276154969, 40048, 1, 0
Offset: 1

Views

Author

Andrew Howroyd, Feb 05 2024

Keywords

Comments

Also, T(n,k) is the number of generalized chord labeled loopless diagrams with k parts of K_n. See the Krasko reference for a full definition.

Examples

			Array begins:
n\k| 1 2    3         4              5                    6 ...
---+-----------------------------------------------------------
 1 | 0 1    1         1              1                    1 ...
 2 | 0 1    4        31            293                 3326 ...
 3 | 0 1   22      1415         140343             20167651 ...
 4 | 0 1  134     75843       83002866         158861646466 ...
 5 | 0 1  866   4446741    55279816356     1450728060971387 ...
 6 | 0 1 5812 276154969 39738077935264 14571371516350429940 ...
 ...
		

Crossrefs

Column 3 is A197657, column 4 appears to be A209183(n)/2.
Cf. A322013 (without linearly adjacent elements equal), A322093.

Programs

  • Mathematica
    T[n_, k_] := If[k == 1, 0, Expand[(-1)^(k (n + 1))/(k - 1)! n Hypergeometric1F1[1 - n, 2, x]^k x^(k - 1)] /. x^p_ :> p!] (* Eric W. Weisstein, Feb 20 2025 *)
  • PARI
    \\ compare with A322013.
    q(n, x) = sum(i=1, n, (-1)^(n-i) * binomial(n-1, n-i) * x^i/i!)
    T(n, k) = if(k > 1, subst(serlaplace(n*q(n, x)^k/x), x, 1)/(k-1)!, 0)

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

Original entry on oeis.org

1, 0, 2, 1092, 2265024, 11804626080, 131402141197200, 2778291737177034960, 102284730928300590754560, 6134232798447803932455457920, 568598490353320413296928514444800, 78076149156802562231395694989534464000, 15336188146163145199585928509793662920345600
Offset: 0

Views

Author

Seiichi Manyama, Nov 15 2018

Keywords

Examples

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

Crossrefs

Programs

  • Mathematica
    a[n_] := Integrate[(-x + 3/2 * x^2 - 1/2 * x^3 + 1/24 * x^4)^n  * Exp[-x],  {x, 0, Infinity}]; Array[a, 10, 0] (* Stefano Spezia, Nov 27 2018 *)

Formula

a(n) = n! * A190830(n).
a(n) = Integral_{0..oo} (-x + 3/2 * x^2 - 1/2 * x^3 + 1/24 * x^4)^n * exp(-x) dx.

A321382 Number of permutations of 6 copies of 1..n with no element equal to another within a distance of 1.

Original entry on oeis.org

1, 0, 2, 48852, 8437796016, 5752866855116280, 12229789732207993835280, 68139526686950961449783790480, 873795428893219442649940388795690880, 23337489207354946577030915302871598795308160
Offset: 0

Views

Author

Seiichi Manyama, Nov 28 2018

Keywords

Crossrefs

Row 6 of A322093.

Formula

a(n) = n! * A190835(n).
a(n) = Integral_{0..infinity} (Sum_{k=1..6} (-1)^(6-k) * binomial(5, 6-k) * x^k/k!)^n * exp(-x) dx.

A322095 Number of permutations of 7 copies of 1..n with no element equal to another within a distance of 1.

Original entry on oeis.org

1, 0, 2, 339720, 549023310936, 4383995385521886720, 131828993822765959468851600, 12202002913678756821228939869239920, 2988325485815656468293009880545684170044800, 1723427149081248135793318785599849462668815779427840
Offset: 0

Views

Author

Seiichi Manyama, Nov 28 2018

Keywords

Crossrefs

Row 7 of A322093.

Formula

a(n) = n! * A190836(n).
a(n) = Integral_{0..infinity} (Sum_{k=1..7} (-1)^(7-k) * binomial(6, 7-k) * x^k/k!)^n * exp(-x) dx.

A322096 Number of permutations of 8 copies of 1..n with no element equal to another within a distance of 1.

Original entry on oeis.org

1, 0, 2, 2403588, 36734931452736, 3470403228952634903280, 1490944857678655357195402606800, 2315418264816304038508896461231618573280, 10937192762438008527903830198163831816546577931520
Offset: 0

Views

Author

Seiichi Manyama, Nov 28 2018

Keywords

Crossrefs

Row 8 of A322093.

Formula

a(n) = n! * A190837(n).
a(n) = Integral_{0..infinity} (Sum_{k=1..8} (-1)^(8-k) * binomial(7, 8-k) * x^k/k!)^n * exp(-x) dx.

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

Original entry on oeis.org

1, 0, 2, 7188, 134631576, 7946203275000, 1210527140790855600, 411490045733601418421040, 280031356887267221923677137280, 351026687723982522494728236869341440, 758933713536173718404757245269681913222400
Offset: 0

Views

Author

Seiichi Manyama, Nov 27 2018

Keywords

Crossrefs

Row 5 of A322093.

Programs

  • Mathematica
    a[n_] := Integrate[(x - 2 * x^2 + x^3 - 1/6 * x^4 + 1/120 * x^5)^n * Exp[-x],  {x, 0, Infinity}]; Array[a, 10, 0] (* Stefano Spezia, Nov 27 2018 *)

Formula

a(n) = n! * A190833(n).
a(n) = Integral_{0..infinity} (x - 2 * x^2 + x^3 - 1/6 * x^4 + 1/120 * x^5)^n * exp(-x) dx.
Showing 1-10 of 13 results. Next