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

A033815 Number of standard permutations of [ a_1..a_n b_1..b_n ] (b_i is not immediately followed by a_i, for all i).

Original entry on oeis.org

1, 1, 14, 426, 24024, 2170680, 287250480, 52370755920, 12585067447680, 3854801333416320, 1465957162768492800, 677696237345719468800, 374281829360322587827200, 243388909697235614324812800, 184070135024053703140543027200, 160192129141963141211280644352000
Offset: 0

Views

Author

Keywords

Comments

Also turns up as the solution to Problem #18, p. 326 of Alan Tucker's Applied Combinatorics, 4th ed, Wiley NY 2002 [Tucker's `n' is the `2n' here]. - John L Leonard, Sep 15 2003
Number of acyclic orientations of the Turán graph T(2n,n). - Alois P. Heinz, Jan 13 2016
n-th term of the n-th forward differences of n!. - Alois P. Heinz, Feb 22 2019

References

  • R. P. Stanley, Enumerative Combinatorics I, Chap.2, Exercise 10, p. 89.

Crossrefs

Main diagonal of array in A068106 and of A047920.
Column k=2 of A372326.

Programs

  • Haskell
    a033815 n = a116854 (2 * n + 1) (n + 1)
    -- Reinhard Zumkeller, Aug 31 2014
  • Maple
    A033815 := proc(n) local i; add(binomial(n, i)*(-1)^i*(2*n - i)!, i = 0 .. n) end;
    # second Maple program:
    A:= proc(n, k) A(n, k):= `if`(k=0, n!, A(n+1, k-1) -A(n, k-1)) end:
    a:= n-> A(n$2):
    seq(a(n), n=0..23);  # Alois P. Heinz, Feb 22 2019
  • Mathematica
    a[n_] := (2n)!*Hypergeometric1F1[-n, -2n, -1]; Table[a[n], {n, 0, 14}] (* Jean-François Alcover, Jun 13 2012, after Vladimir Reshetnikov *)

Formula

a(n) = A002119(n)*n!*(-1)^n.
D-finite with recurrence a(n) = 2n*(2n-1)*a(n-1) + n*(n-1)*a(n-2).
a(n) = Sum_{i=0..n} binomial(n, i)*(-1)^i*(2*n-i)!.
From John L Leonard, Sep 15 2003: (Start)
a(n) = Sum_{i=0..n} C(n, i)*(2n-i)!*Sum_{j=0..2n-i} (-1)^j/j!.
a(n) = n!*Sum_{i=0..n} C(n, i)*n!/(n-i)!*Sum_{j=0..n-i} (-1)^j*C(n-i, j)*(n-j)!/i!. (End)
a(n) = Sum_{k=0..n} binomial(n,k)*A000166(n+k). - Vladeta Jovovic, Sep 04 2006
a(n) = A116854(2*n+1,n+1). - Reinhard Zumkeller, Aug 31 2014
a(n) = A267383(2n,n). - Alois P. Heinz, Jan 13 2016
a(n) ~ sqrt(Pi) * 2^(2*n + 1) * n^(2*n + 1/2) / exp(2*n + 1/2). - Vaclav Kotesovec, Feb 18 2017
a(n) = n!*exp(-1/2)*((-1)^n * BesselI(n+1/2,1/2)*Pi^(1/2) + BesselK(n+1/2,1/2)/Pi^(1/2) ). - Mark van Hoeij, Jul 15 2022

A266695 Number of acyclic orientations of the Turán graph T(n,2).

Original entry on oeis.org

1, 1, 2, 4, 14, 46, 230, 1066, 6902, 41506, 329462, 2441314, 22934774, 202229266, 2193664790, 22447207906, 276054834902, 3216941445106, 44222780245622, 578333776748674, 8787513806478134, 127464417117501586, 2121181056663291350, 33800841048945424546
Offset: 0

Views

Author

Alois P. Heinz, Jan 02 2016

Keywords

Comments

The Turán graph T(n,2) is also the complete bipartite graph K_{floor(n/2),ceiling(n/2)}.
An acyclic orientation is an assignment of a direction to each edge such that no cycle in the graph is consistently oriented. Stanley showed that the number of acyclic orientations of a graph G is equal to the absolute value of the chromatic polynomial X_G(q) evaluated at q=-1.

Crossrefs

Column k=2 of A267383.
Bisections give A048163 (even part), A188634 (odd part).

Programs

  • Maple
    a:= n-> (p-> add(Stirling2(n-p+1, i+1)*Stirling2(p+1, i+1)*
             i!^2, i=0..p))(iquo(n, 2)):
    seq(a(n), n=0..25);
  • Mathematica
    a[n_] := With[{q=Quotient[n, 2]}, Sum[StirlingS2[n-q+1, i+1] StirlingS2[ q+1, i+1] i!^2, {i, 0, q}]];
    Array[a, 24, 0] (* Jean-François Alcover, Nov 06 2018 *)

Formula

a(n) = Sum_{i=0..floor(n/2)} i!^2 * Stirling2(ceiling(n/2)+1,i+1) * Stirling2(floor(n/2)+1,i+1).
a(n) = A099594(floor(n/2),ceiling(n/2)).
a(n) = Sum_{k=0..n} abs(A266972(n,k)).
a(n) ~ n! / (sqrt(1-log(2)) * 2^n * (log(2))^(n+1)). - Vaclav Kotesovec, Feb 18 2017

A370961 a(n) = number of acyclic orientations of the complete tripartite graph K_{n,n,n}.

Original entry on oeis.org

1, 6, 426, 122190, 90768378, 138779942046, 379578822373866, 1689637343582548590, 11434884125767376107098, 111765072808554847704145086, 1515592947854931941485836600906, 27609710924806869786487193747541390, 658043992934027491354757341987635993018
Offset: 0

Views

Author

N. J. A. Sloane, Apr 04 2024

Keywords

Crossrefs

Main diagonal of A372254.
Row n=3 of A372326.

Formula

a(n) = A266858(3n) = A267383(3n,3). - Alois P. Heinz, Apr 17 2024
a(n) = Sum_{k=0..3n} (-1)^k * A212220(n,k). - Alois P. Heinz, May 02 2024

Extensions

More terms from Don Knuth, Apr 07 2024
a(0)=1 prepended by Alois P. Heinz, Apr 17 2024

A372254 Number A(n,k) of acyclic orientations of the complete tripartite graph K_{n,n,k}; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 2, 1, 6, 14, 1, 18, 78, 230, 1, 54, 426, 1902, 6902, 1, 162, 2286, 15402, 76110, 329462, 1, 486, 12090, 122190, 822954, 4553166, 22934774, 1, 1458, 63198, 951546, 8724078, 61796298, 381523758, 2193664790, 1, 4374, 327306, 7290942, 90768378, 823457454, 6241779786, 42700751022, 276054834902
Offset: 0

Views

Author

Alois P. Heinz, Apr 24 2024

Keywords

Comments

An acyclic orientation is an assignment of a direction to each edge such that no cycle in the graph is consistently oriented. Stanley showed that the number of acyclic orientations of a graph G is equal to the absolute value of the chromatic polynomial X_G(q) evaluated at q=-1.

Examples

			Square array A(n,k) begins:
       1,       1,        1,         1,           1,            1, ...
       2,       6,       18,        54,         162,          486, ...
      14,      78,      426,      2286,       12090,        63198, ...
     230,    1902,    15402,    122190,      951546,      7290942, ...
    6902,   76110,   822954,   8724078,    90768378,    928340190, ...
  329462, 4553166, 61796298, 823457454, 10779805722, 138779942046, ...
		

Crossrefs

Rows n=0-2 give: A000012, A008776, A370960.
Column k=0 gives A048163(n+1).
Main diagonal gives A370961.

Programs

  • Maple
    g:= proc(n) option remember; `if`(n=0, 1, add(
          expand(x*g(n-j))*binomial(n-1, j-1), j=1..n))
        end:
    A:= proc(n, k) option remember; local q, l, b; q, l, b:= -1, [n$2, k],
          proc(n, j) option remember; `if`(j=1, mul(q-i, i=0..n-1)*
            (q-n)^l[1], add(b(n+m, j-1)*coeff(g(l[j]), x, m), m=0..l[j]))
          end; abs(b(0, 3))
        end:
    seq(seq(A(n, d-n), n=0..d), d=0..9);
  • Mathematica
    g[n_] := g[n] = If[n == 0, 1, Sum[Expand[x*g[n-j]]*Binomial[n-1, j-1], {j, 1, n}]];
    A[n_, k_] := A[n, k] = Module[{q, l, b}, {q, l} = {-1, {n, n, k}}; b[n0_, j_] := b[n0, j] = If[j == 1, Product[q-i, {i, 0, n0-1}]*(q-n0)^l[[1]], Sum[b[n0 + m, j-1]*Coefficient[g[l[[j]]], x, m], {m, 0, l[[j]]}]]; Abs[b[0, 3]]];
    Table[Table[A[n, d-n], {n, 0, d}], {d, 0, 9}] // Flatten (* Jean-François Alcover, Apr 25 2024, after Alois P. Heinz *)

A372326 Number A(n,k) of acyclic orientations of the Turán graph T(k*n,n); square array A(n,k), n>=0, k>=1, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 14, 6, 1, 1, 1, 230, 426, 24, 1, 1, 1, 6902, 122190, 24024, 120, 1, 1, 1, 329462, 90768378, 165392664, 2170680, 720, 1, 1, 1, 22934774, 138779942046, 4154515368024, 457907248920, 287250480, 5040, 1
Offset: 0

Views

Author

Alois P. Heinz, Apr 27 2024

Keywords

Comments

The Turán graph T(k*n,n) is the complete n-partite graph K_{k,...,k}.
An acyclic orientation is an assignment of a direction to each edge such that no cycle in the graph is consistently oriented. Stanley showed that the number of acyclic orientations of a graph G is equal to the absolute value of the chromatic polynomial X_G(q) evaluated at q=-1.

Examples

			Square array A(n,k) begins:
  1,   1,       1,            1,                  1, ...
  1,   1,       1,            1,                  1, ...
  1,   2,      14,          230,               6902, ...
  1,   6,     426,       122190,           90768378, ...
  1,  24,   24024,    165392664,      4154515368024, ...
  1, 120, 2170680, 457907248920, 495810323060597880, ...
		

Crossrefs

Columns k=0-2 give: A000012, A000142, A033815.
Rows n=0+1,2-3 give: A000012, A048163(k+1), A370961.
Main diagonal gives A372084.
Cf. A267383.

Programs

  • Maple
    g:= proc(n) option remember; `if`(n=0, 1, add(
          expand(x*g(n-j))*binomial(n-1, j-1), j=1..n))
        end:
    A:= proc(n, k) option remember; local q, l, b; q, l, b:= -1, [k$n, 0],
          proc(n, j) option remember; `if`(j=1, mul(q-i, i=0..n-1)*
            (q-n)^l[1], add(b(n+m, j-1)*coeff(g(l[j]), x, m), m=0..l[j]))
          end; abs(b(0, nops(l)))
        end:
    seq(seq(A(n, d-n), n=0..d), d=0..10);
  • Mathematica
    g[n_] := g[n] = If[n == 0, 1, Sum[Expand[x*g[n - j]]*Binomial[n - 1, j - 1], {j, 1, n}]];
    A[n_, k_] := A[n, k] = Module[{q = -1, l, b}, l = Append[Table[k, {n}], 0];
       b[nn_, j_] := b[nn, j] = If[j == 1, Product[q - i, {i, 0, nn - 1}]*
       (q - nn)^l[[1]], Sum[b[nn + m, j - 1]*Coefficient[g[l[[j]]], x, m],
       {m, 0, l[[j]]}]];
       Abs[b[0, Length[l]]]];
    Table[Table[A[n, d - n], {n, 0, d}], {d, 0, 10}] // Flatten (* Jean-François Alcover, Jun 09 2024, after Alois P. Heinz *)

Formula

A(n,k) = A267383(k*n,n).

A161132 Number of permutations of {1,2,...,n} that have no even fixed points.

Original entry on oeis.org

1, 1, 1, 4, 14, 78, 426, 3216, 24024, 229080, 2170680, 25022880, 287250480, 3884393520, 52370755920, 812752093440, 12585067447680, 220448163358080, 3854801333416320, 75225258805132800, 1465957162768492800, 31537353006189676800, 677696237345719468800
Offset: 0

Views

Author

Emeric Deutsch, Jul 18 2009

Keywords

Examples

			a(3)=4 because we have 132, 312, 213, and 231.
		

Crossrefs

Programs

  • Maple
    d[0] := 1: for n to 25 do d[n] := n*d[n-1]+(-1)^n end do: a := proc (n) options operator, arrow: add(d[n-j]*binomial(ceil((1/2)*n), j), j = 0 .. ceil((1/2)*n)) end proc: seq(a(n), n = 0 .. 22);
    a := proc (n) options operator, arrow: add((-1)^j*binomial(floor((1/2)*n), j)*factorial(n-j), j = 0 .. floor((1/2)*n)) end proc; seq(a(n), n = 0 .. 22); # Emeric Deutsch, Jul 18 2009
    a := n -> n!*hypergeom([-floor(n/2)], [-n], -1):
    seq(simplify(a(n)), n = 0..22);  # Peter Luschny, Jul 15 2022
  • Mathematica
    a[n_] := Sum[Subfactorial[n-j]*Binomial[Ceiling[n/2], j], {j, 0, Ceiling[ n/2]}]; Table[a[n], {n, 0, 22}] (* Jean-François Alcover, Feb 19 2017 *)
  • PARI
    for (n=0, 30, print1(sum(j=0, floor(n/2), (-1)^j*binomial(floor(n/2),j)*(n - j)!),", ")) \\ Indranil Ghosh, Mar 08 2017
    
  • Python
    import math
    f=math.factorial
    def C(n, r): return f(n)/ f(r)/ f(n - r)
    def A161132(n):
        s=0
        for j in range(0, (n/2)+1):
            s += (-1)**j*C(n/2, j)*f(n - j)
        return s # Indranil Ghosh, Mar 08 2017

Formula

a(n) = Sum_{j=0..ceiling(n/2)} d(n-j)*binomial(ceiling(n/2), j), where d(i) = A000166(i) are the derangement numbers.
a(n) = Sum_{j=0..floor(n/2)} (-1)^j*binomial(floor(n/2),j)*(n-j)!.
a(n) = A267383(n,ceiling(n/2)). - Alois P. Heinz, Jan 13 2016
a(n) ~ exp(-1/2) * n!. - Vaclav Kotesovec, Feb 18 2017
From Mark van Hoeij, Jul 15 2022: (Start)
a(2*n) = A033815(n),
a(2*n+1) = (A033815(n) + A033815(n+1)/(n+1))/2. (End)
From Peter Luschny, Jul 15 2022: (Start)
a(n) = n!*hypergeom([-floor(n/2)], [-n], -1).
a(n) = A068106(n, ceiling(n/2)). (End)
D-finite with recurrence +16*a(n) -24*a(n-1) +4*(-4*n^2+8*n+3)*a(n-2) +4*(2*n^2-10*n+9)*a(n-3) +2*(-4*n^2+22*n-31)*a(n-4) +2*(n-2)*(n-4)*a(n-5) -(n-4)*(n-5)*a(n-6)=0. - R. J. Mathar, Jul 26 2022

A372261 Number T(n,k,j) of acyclic orientations of the complete tripartite graph K_{n,k,j}; triangle of triangles T(n,k,j), n>=0, k=0..n, j=0..k, read by rows.

Original entry on oeis.org

1, 1, 2, 6, 1, 4, 18, 14, 78, 426, 1, 8, 54, 46, 330, 2286, 230, 1902, 15402, 122190, 1, 16, 162, 146, 1374, 12090, 1066, 10554, 101502, 951546, 6902, 76110, 822954, 8724078, 90768378, 1, 32, 486, 454, 5658, 63198, 4718, 57054, 657210, 7290942, 41506, 525642, 6495534, 78463434, 928340190
Offset: 0

Views

Author

Alois P. Heinz, Apr 24 2024

Keywords

Comments

An acyclic orientation is an assignment of a direction to each edge such that no cycle in the graph is consistently oriented. Stanley showed that the number of acyclic orientations of a graph G is equal to the absolute value of the chromatic polynomial X_G(q) evaluated at q=-1.

Examples

			Triangle of triangles T(n,k,j) begins:
    1;
  ;
    1;
    2,    6;
  ;
    1;
    4,   18;
   14,   78,   426;
  ;
    1;
    8,   54;
   46,  330,  2286;
  230, 1902, 15402, 122190;
  ;
  ...
		

Crossrefs

T(n,n,n) gives A370961.
T(n,n,0) gives A048163(n+1).
T(n+1,n,0) gives A188634(n+1).
T(n,1,1) gives A008776.
T(n,2,2) gives A370960.

Programs

  • Maple
    g:= proc(n) option remember; `if`(n=0, 1, add(
          expand(x*g(n-j))*binomial(n-1, j-1), j=1..n))
        end:
    T:= proc() option remember; local q, l, b; q, l, b:= -1, [args],
          proc(n, j) option remember; `if`(j=1, mul(q-i, i=0..n-1)*
            (q-n)^l[1], add(b(n+m, j-1)*coeff(g(l[j]), x, m), m=0..l[j]))
          end; abs(b(0, nops(l)))
        end:
    seq(seq(seq(T(n, k, j), j=0..k), k=0..n), n=0..5);
  • Mathematica
    g[n_] := g[n] = If[n == 0, 1, Sum[Expand[x*g[n - j]]*Binomial[n - 1, j - 1], {j, 1, n}]];
    T[n_, k_, j_] := T[n, k, j] = Module[{q = -1, l = {n, k, j}, b},
       b[n0_, j0_] := b[n0, j0] = If[j0 == 1, Product[q - i, {i, 0, n0 - 1}]*
       (q - n0)^n, Sum[b[n0 + m, j0 - 1]*Coefficient[g[l[[j0]]], x, m],
       {m, 0, l[[j0]]}]];
    Abs[b[0, 3]]];
    Table[Table[Table[T[n, k, j], {j, 0, k}], {k, 0, n}], {n, 0, 5}] // Flatten (* Jean-François Alcover, Jun 14 2024, after Alois P. Heinz *)

A266858 Number of acyclic orientations of the Turán graph T(n,3).

Original entry on oeis.org

1, 1, 2, 6, 18, 78, 426, 2286, 15402, 122190, 951546, 8724078, 90768378, 928340190, 10779805722, 138779942046, 1759271695338, 24739709631678, 379578822373866, 5743346972756526, 94864142045862282, 1689637343582548590, 29717468115957434586, 563879701735681033998
Offset: 0

Views

Author

Alois P. Heinz, Jan 04 2016

Keywords

Comments

An acyclic orientation is an assignment of a direction to each edge such that no cycle in the graph is consistently oriented. Stanley showed that the number of acyclic orientations of a graph G is equal to the absolute value of the chromatic polynomial X_G(q) evaluated at q=-1.

Crossrefs

Column k=3 of A267383.
Trisection gives A370961.

Programs

  • Mathematica
    A[n_, k_] := A[n, k] = Module[{b, l, q}, q = -1; l = Join[Array[Floor[ n/k]&, k - Mod[n, k]], Array[Ceiling[n/k]&, Mod[n, k]]]; b[nn_, j_] := b[nn, j] = If[j==1, (q-nn)^l[[1]] Product[q-i, {i, 0, nn-1}], Sum[b[nn + m, j-1] StirlingS2[l[[j]], m], {m, 0, l[[j]]}]]; Abs[b[0, k]]];
    a[n_] := A[n, 3];
    Table[a[n], {n, 0, 23}] (* Jean-François Alcover, Aug 20 2018, after Alois P. Heinz *)

Formula

a(n) ~ n! / (2*(1 - log(3/2)) * 3^n * (log(3/2))^(n+1)). - Vaclav Kotesovec, Feb 18 2017

A370613 Total number of acyclic orientations in all complete multipartite graphs K_lambda, where lambda ranges over all partitions of n into distinct parts.

Original entry on oeis.org

1, 1, 1, 5, 9, 63, 509, 2959, 22453, 247949, 3080991, 28988331, 407320739, 5122243495, 82583577967, 1430027615585, 22556817627789, 395098668828675, 7979894546677853, 154786744386253387, 3355612019167352821, 78865333300205585345, 1769663675666499515751
Offset: 0

Views

Author

Alois P. Heinz, Apr 30 2024

Keywords

Comments

An acyclic orientation is an assignment of a direction to each edge such that no cycle in the graph is consistently oriented. Stanley showed that the number of acyclic orientations of a graph G is equal to the absolute value of the chromatic polynomial X_G(q) evaluated at q=-1.
All terms are odd.

Crossrefs

Programs

  • Maple
    g:= proc(n) option remember; `if`(n=0, 1, add(
          expand(x*g(n-j))*binomial(n-1, j-1), j=1..n))
        end:
    b:= proc(t, n, i) option remember; `if`(i*(i+1)/2 abs(b(0, n$2)):
    seq(a(n), n=0..22);

A370614 Triangle T(n,k) in which row n lists in increasing order the number of acyclic orientations of complete multipartite graphs K_lambda, where lambda is a partition of n into distinct parts; triangle T(n,k), n>=0, k = 1..A000009(n), read by rows.

Original entry on oeis.org

1, 1, 1, 1, 4, 1, 8, 1, 16, 46, 1, 32, 146, 330, 1, 64, 454, 1066, 1374, 1, 128, 1394, 4718, 5658, 10554, 1, 256, 4246, 20266, 23118, 41506, 57054, 101502, 1, 512, 12866, 85310, 93930, 237686, 302730, 525642, 657210, 1165104, 1, 1024, 38854, 354106, 380094
Offset: 0

Views

Author

Alois P. Heinz, Apr 30 2024

Keywords

Comments

An acyclic orientation is an assignment of a direction to each edge such that no cycle in the graph is consistently oriented. Stanley showed that the number of acyclic orientations of a graph G is equal to the absolute value of the chromatic polynomial X_G(q) evaluated at q=-1.

Examples

			Triangle T(n,k) begins:
  1;
  1;
  1;
  1,   4;
  1,   8;
  1,  16,   46;
  1,  32,  146,   330;
  1,  64,  454,  1066,  1374;
  1, 128, 1394,  4718,  5658, 10554;
  1, 256, 4246, 20266, 23118, 41506, 57054, 101502;
  ...
		

Crossrefs

Columns k=1-2 give: A000012, A011782 (for n>=3).
Row sums give A370613.

Programs

  • Maple
    g:= proc(n) option remember; `if`(n=0, 1, add(
          expand(x*g(n-j))*binomial(n-1, j-1), j=1..n))
        end:
    h:= proc() option remember; local q, l, b; q, l, b:= -1, args,
          proc(n, j) option remember; `if`(j=1, mul(q-i, i=0..n-1)*
            (q-n)^l[1], add(b(n+m, j-1)*coeff(g(l[j]), x, m), m=0..l[j]))
          end; abs(b(0, nops(l)))
        end:
    b:= proc(n, i, l) `if`(i*(i+1)/2 sort(b(n$2, [0]))[]:
    seq(T(n), n=0..12);
Showing 1-10 of 20 results. Next