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

 

Logo

Please make a donation to keep the OEIS running. We are now in our 55th year. In the past year we added 12000 new sequences and reached 8000 citations (which often say "discovered thanks to the OEIS"). We need to raise money to hire someone to manage submissions, which would reduce the load on our editors and speed up editing.
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A162978 Number of fixed points in all alternating (i.e., down-up) permutations of {1,2,...,n}. 3
1, 0, 1, 4, 15, 52, 257, 1272, 7679, 47864, 346113, 2604380, 22022143, 194053836, 1881735169, 18998097328, 207983607807, 2366490065968, 28880901505025, 365599818496116, 4922617151619071, 68612903386404260, 1010501269355233281, 15376572385777544744 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,4

COMMENTS

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

a(2n+1) = A162977(2n+1).

LINKS

Alois P. Heinz, Table of n, a(n) for n = 1..485

R. P. Stanley, Alternating permutations Talk slides.

FORMULA

a(2n) = E(2n) + (-1)^n*E(0) + 2*Sum_{j=1..n-1} (-1)^j*E(2n-2j), a(2n+1) = Sum_{j=0..n} (-1)^j*E(2n+1-2j), where E(i) = A000111(i) are the Euler (or up-down) numbers.

EXAMPLE

a(4)=4 because in the 5 (=A000111(4)) down-up permutations of {1,2,3,4}, namely 4132, 3142, 2143, 4231, and 3241, we have a total of 1+0+0+2+1=4 fixed points.

MAPLE

E := sec(x)+tan(x): Eser := series(E, x = 0, 30): for n from 0 to 27 do E[n] := factorial(n)*coeff(Eser, x, n) end do: for n to 12 do a[2*n] := E[2*n]+(-1)^n*E[0]+2*add((-1)^j*E[2*n-2*j], j = 1 .. n-1) end do: for n from 0 to 12 do a[2*n+1] := add((-1)^j*E[2*n+1-2*j], j = 0 .. n) end do: seq(a[n], n = 1 .. 25);

MATHEMATICA

a111[n_] := If[EvenQ[n], Abs[EulerE[n]], Abs[(2^(n+1) (2^(n+1) - 1) BernoulliB[n+1])/(n+1)]];

a[n_?EvenQ] := With[{m = n/2}, a111[2m] + (-1)^m a111[0] + 2Sum[(-1)^j a111[2m - 2j], {j, 1, m-1}]];

a[n_?OddQ] := With[{m = (n-1)/2}, Sum[(-1)^j a111[2m+1-2j], {j, 0, m}]];

Array[a, 25] (* Jean-Fran├žois Alcover, Jul 24 2018 *)

CROSSREFS

Cf. A000111, A162977, A162979.

Sequence in context: A208722 A057332 A230623 * A171309 A210781 A303271

Adjacent sequences:  A162975 A162976 A162977 * A162979 A162980 A162981

KEYWORD

nonn

AUTHOR

Emeric Deutsch, Aug 06 2009

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
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 10 12:25 EST 2019. Contains 329895 sequences. (Running on oeis4.)