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.

A187248 Number of permutations of [n] having only cycles with at least 3 alternating runs (it is assumed that the smallest element of the cycle is in the first position).

Original entry on oeis.org

1, 0, 0, 0, 2, 16, 104, 688, 5116, 44224, 438560, 4851136, 58603544, 764606016, 10715043104, 160692920256, 2570016145680, 43678554864128, 786135111482112, 14936420654180864, 298733557232591136, 6273502048592506112, 138018105454095739008, 3174423293668325353216
Offset: 0

Views

Author

Emeric Deutsch, Mar 07 2011

Keywords

Comments

a(n) = A187247(n,0).

Examples

			a(4)=2 because we have (1423) and (1324).
		

Crossrefs

Cf. A187247.

Programs

  • Maple
    g := exp((1-2*z-exp(2*z))*1/4)/(1-z): gser := series(g, z = 0, 25): seq(factorial(n)*coeff(gser, z, n), n = 0 .. 23);
    # second Maple program:
    a:= proc(n) option remember;
          `if`(n=0, 1, add(a(n-j)*binomial(n-1, j-1)*
          `if`(j=1, 0, (j-1)!-2^(j-2)), j=1..n))
        end:
    seq(a(n), n=0..30);  # Alois P. Heinz, Apr 15 2017
  • Mathematica
    a[n_] := a[n] = If[n == 0, 1, Sum[a[n-j]*Binomial[n-1, j-1]* If[j == 1, 0, (j-1)! - 2^(j-2)], {j, 1, n}]];
    Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Jun 16 2018, after Alois P. Heinz *)

Formula

E.g.f.: g(z) = exp[(1-2z-exp(2z))/4]/(1-z).
a(n) ~ exp((-1-exp(2))/4) * n!. - Vaclav Kotesovec, Mar 18 2014

A187249 Number of cycles with at most 2 alternating runs in all permutations of [n] (it is assumed that the smallest element of the cycle is in the first position).

Original entry on oeis.org

0, 1, 3, 11, 48, 248, 1504, 10560, 84544, 761024, 7610496, 83715968, 1004592640, 13059706368, 182835893248, 2742538406912, 43880614526976, 745970446991360, 13427468045910016, 255121892872421376, 5102437857448689664, 107151195006423007232, 2357326290141307207680
Offset: 0

Views

Author

Emeric Deutsch, Mar 07 2011

Keywords

Comments

a(n) = Sum_{k>=0} k * A187247(n,k).

Examples

			a(3)=11 because in (1)(2)(3), (1)(23), (12)(3), (13)(2), (123), and (132) all cycles have at most  2 alternating runs.
		

Crossrefs

Cf. A187247.

Programs

  • Maple
    g := (1/4*(exp(2*z)-1+2*z))/(1-z): gser := series(g, z = 0, 25): seq(factorial(n)*coeff(gser, z, n), n = 0 .. 22);
    # second Maple program:
    b:= proc(n) option remember; expand(
          `if`(n=0, 1, add(b(n-j)*binomial(n-1, j-1)*
          `if`(j=1, x, (j-1)!+2^(j-2)*(x-1)), j=1..n)))
        end:
    a:= n-> (p-> add(coeff(p, x, i)*i, i=0..n))(b(n)):
    seq(a(n), n=0..30);  # Alois P. Heinz, Apr 15 2017
  • Mathematica
    CoefficientList[Series[(E^(2*x)-1+2*x)/(4*(1-x)), {x, 0, 20}], x]* Range[0, 20]! (* Vaclav Kotesovec, Mar 15 2014 *)

Formula

E.g.f.: g(z) = (1/4)[exp(2z) - 1 +2z]/(1-z).
a(n) ~ (exp(2)+1)/4 * n! = 2.09726402473266... * n!. - Vaclav Kotesovec, Mar 15 2014
D-finite with recurrence a(n) +(-n-2)*a(n-1) +2*(n-1)*a(n-2)=0. - R. J. Mathar, Jul 26 2022

A187250 Triangle read by rows: T(n,k) is the number of permutations of [n] having k cycles with at least 3 alternating runs (it is assumed that the smallest element of a cycle is in the first position), 0<=k<=floor(n/4).

Original entry on oeis.org

1, 1, 2, 6, 22, 2, 94, 26, 460, 260, 2532, 2508, 15420, 24760, 140, 102620, 254968, 5292, 739512, 2760432, 128856, 5729192, 31547344, 2640264, 47429896, 381339368, 50186136, 46200, 417429800, 4879612808, 926494712, 3483480, 3888426512, 66107044176, 17025751600, 157068912
Offset: 0

Views

Author

Emeric Deutsch, Mar 08 2011

Keywords

Comments

Number of entries in row n is 1+floor(n/4).
Sum of entries in row n is n!.
T(n,0)=A187251(n).
Sum(k*T(n,k), k>=0) = A187252(n).

Examples

			T(4,1)=2 because we have (1324) and (1423).
Triangle starts:
1;
1;
2;
6;
22,2;
94,26;
460,260;
		

Crossrefs

Programs

  • Maple
    G := exp((1/4*(1-t))*(2*z-1+exp(2*z)))/(1-z)^t: Gser := simplify(series(G, z = 0, 17)): for n from 0 to 14 do P[n] := sort(factorial(n)*coeff(Gser, z, n)) end do: for n from 0 to 14 do seq(coeff(P[n], t, k), k = 0 .. floor((1/4)*n)) end do; # yields sequence in triangular form

Formula

E.g.f.: G(t,z) = exp[(1/4)(1-t)(2z-1+exp(2z))]/(1-z)^t.
The 4-variate g.f. H(u,v,w,z) (exponential with respect z), where u marks number of cycles with 1 alternating run, v marks number of cycles with 2 alternating runs, w marks the number of all cycles, and z marks the size of the permutation, is given by H(u,v,w,z) = exp[(1/4)w((v-1)(exp(2z)+2z)+4(u-v)exp(z)+1-4u+3v)]/(1-z)^w.
We have G(t,z) = H(1/t,1/t,t,z).
Showing 1-3 of 3 results.