login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A187246 Number of cycles with 2 alternating runs in all permutations of [n] (it is assumed that the smallest element of the cycle is in the first position). 3
0, 0, 0, 1, 7, 42, 267, 1900, 15263, 137494, 1375195, 15127656, 181532895, 2359929682, 33039019643, 495585302836, 7929364861759, 134799202682670, 2426385648353595, 46101327318849376, 922026546377249663, 19362557473922767210, 425976264426301927195 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,5

COMMENTS

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

LINKS

Alois P. Heinz, Table of n, a(n) for n = 0..450

FORMULA

E.g.f.: g(z)=(1/4)[3+2z+exp(2z)-4exp(z)]/(1-z).

a(n) ~ (5/4-exp(1)+exp(2)/4) * n! = 0.378982196273617... * n!. - Vaclav Kotesovec, Mar 15 2014

EXAMPLE

a(4)=7 because each of the following permutations of {1,2,3,4} has 1 cycle with 2 alternating runs: (132)(4), (142)(3), (143)(2), (1)(243), (1243), (1342), and (1432); the remaining 17 permutations have none.

MAPLE

g := (1/4*(3+2*z+exp(2*z)-4*exp(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, 1, (j-1)!+(2^(j-2)-1)*(x-1)), j=1..n)))

    end:

a:= n-> (p-> add(coeff(p, x, i)*i, i=0..degree(p)))(b(n)):

seq(a(n), n=0..30);  # Alois P. Heinz, Apr 15 2017

MATHEMATICA

CoefficientList[Series[(3+2*x+E^(2*x)-4*E^(x))/(4*(1-x)), {x, 0, 20}], x]* Range[0, 20]! (* Vaclav Kotesovec, Mar 15 2014 *)

CROSSREFS

Cf. A187244.

Sequence in context: A152239 A152240 A221794 * A278152 A271427 A073506

Adjacent sequences:  A187243 A187244 A187245 * A187247 A187248 A187249

KEYWORD

nonn

AUTHOR

Emeric Deutsch, Mar 07 2011

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified February 19 18:31 EST 2018. Contains 299356 sequences. (Running on oeis4.)