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.

A302895 Number of permutations of [n] having exactly two alternating descents.

Original entry on oeis.org

2, 7, 36, 182, 1056, 6669, 46348, 350240, 2866632, 25260211, 238550196, 2403846954, 25749417440, 292191829273, 3501634042140, 44194287012404, 585947863072440, 8142408896706495, 118341851934179140, 1795485894869716670, 28386889319060192592
Offset: 3

Views

Author

Alois P. Heinz, Apr 15 2018

Keywords

Comments

Index i is an alternating descent of permutation p if either i is odd and p(i) > p(i+1), or i is even and p(i) < p(i+1).

Examples

			a(3) = 2: 213, 312.
a(4) = 7: 1243, 1342, 2134, 2341, 3124, 4123, 4321.
		

Crossrefs

Column k=3 of A145876.

Programs

  • Maple
    b:= proc(u, o) option remember; series(`if`(u+o=0, 1,
           add(b(o+j-1, u-j)*x, j=1..u)+
           add(b(o-j, u-1+j),   j=1..o)), x, 4)
        end:
    a:= n-> coeff(b(n, 0), x, 3):
    seq(a(n), n=3..30);
  • Mathematica
    nmax = 30; Drop[CoefficientList[Series[((4 + (-2 + x)*x - 4*Cos[x])*(1 + Cos[x]) + (4 + (-6 + x)*x)*Sin[x])/(3 + 2*Cos[x] - Cos[2*x] - 2*(2 + Cos[x])*Sin[x]), {x, 0, nmax}], x] * Range[0, nmax]!, 3] (* Vaclav Kotesovec, Apr 30 2018 *)

Formula

a(n) ~ (4 - Pi)^2 * 2^(n + 3/2) * n^(n + 5/2) / (exp(n) * Pi^(n + 5/2)). - Vaclav Kotesovec, Apr 29 2018
E.g.f.: ((4 + (-2 + x)*x - 4*cos(x))*(1 + cos(x)) + (4 + (-6 + x)*x)*sin(x))/(3 + 2*cos(x) - cos(2*x) - 2*(2 + cos(x))*sin(x)). - Vaclav Kotesovec, Apr 30 2018