The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A186371 Number of up-down runs in all permutations of {1,2,...,n}. 1
0, 1, 3, 13, 68, 420, 3000, 24360, 221760, 2237760, 24796800, 299376000, 3911846400, 55005350400, 828193766400, 13294689408000, 226663557120000, 4090405423104000, 77895546753024000, 1561112121913344000, 32844177110384640000, 723788347432550400000 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
The up-down runs of a permutation p are the alternating runs of the permutation p endowed with a 0 in the front. For example, 75814632 has 6 up-down runs: 07, 75, 58, 81, 146, and 632.
LINKS
FORMULA
a(n) = Sum_{k=1..n} k*A186370(n,k).
a(n) = n!*(4n+1)/6 for n>=2.
E.g.f.: g(z) = z(6-3z+z^2)/[6(1-z)^2].
D-finite with recurrence 4*a(n) +(-4*n-7)*a(n-1) +3*(n-1)*a(n-2)=0. - R. J. Mathar, Jul 22 2022
EXAMPLE
a(3)=13 because the permutations 123, 132, 213, 231, 312, and 321 have a total of 1 + 2 + 3 + 2 + 3 + 2 = 13 up-down runs.
MAPLE
0, 1, seq((1/6)*factorial(n)*(4*n+1), n = 2 .. 20);
MATHEMATICA
Join[{0, 1}, Table[n! (4 n + 1)/6, {n, 2, 20}]] (* Vincenzo Librandi, Sep 11 2015 *)
PROG
(Magma) [0, 1] cat [Factorial(n)*(4*n+1)/6: n in [2..30]]; // Vincenzo Librandi, Sep 11 2015
CROSSREFS
Sequence in context: A000260 A192737 A125279 * A121954 A058307 A020107
KEYWORD
nonn,easy
AUTHOR
Emeric Deutsch and Ira M. Gessel, Mar 01 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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 14 11:19 EDT 2024. Contains 372532 sequences. (Running on oeis4.)