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.

A302896 Number of permutations of [n] having exactly three alternating descents.

Original entry on oeis.org

5, 26, 182, 1196, 8699, 67054, 556952, 4945368, 46901985, 473324450, 5068610666, 57423496708, 686431008183, 8636011443670, 114084907758220, 1579087434474288, 22855092931547133, 345270138380243850, 5434925832561946750, 89001957427837012060
Offset: 4

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(4) = 5: 2143, 3142, 3241, 4132, 4231.
a(5) = 26: 12435, 12534, 13425, 13524, 14523, 21345, 21543, 23415, 23514, 24513, 31245, 31542, 32541, 34512, 41235, 41532, 42531, 43215, 43521, 51234, 51432, 52431, 53214, 53421, 54213, 54312.
		

Crossrefs

Column k=4 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, 5)
        end:
    a:= n-> coeff(b(n, 0), x, 4):
    seq(a(n), n=4..30);
  • Mathematica
    nmax = 25; Drop[CoefficientList[Series[(6*Cos[x]^2 + (3*x^2 - 12*x + 6*Sin[x] + 6)*Cos[x] + (x^3 - 6*x^2 + 18*x - 12)*Sin[x] + 2*x^3 - 12*x^2 + 18*x - 12)/(6*Cos[x]^2 + 12*Sin[x] - 12), {x, 0, nmax}], x] * Range[0, nmax]!, 4] (* Vaclav Kotesovec, Apr 30 2018 *)

Formula

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