login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 59th year, we have over 358,000 sequences, and we’ve crossed 10,300 citations (which often say “discovered thanks to the OEIS”).

Other ways to Give
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A152665 Number of leading even entries in all permutations of {1,2,...,n}. 2
0, 1, 2, 16, 60, 540, 3024, 32256, 241920, 3024000, 28512000, 410572800, 4670265600, 76281004800, 1017080064000, 18598035456000, 284549942476800, 5762136335155200, 99527809425408000, 2211729098342400000 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

a(n) = Sum_{k=0..floor(n/2)} k*A152664(n,k).

LINKS

Table of n, a(n) for n=1..20.

FORMULA

a(2n+1) = n(2n+1)!/(n+2);

a(2n) = n(2n)!/(n+1).

D-finite with recurrence 2*(n+3)*a(n) +(-5*n-8)*a(n-1) +(-2*n^3-2*n^2-n-4)*a(n-2) +(n-2)*(3*n^2-3*n+2)*a(n-3) +(n-3)*(n-2)^2*a(n-4)=0. - R. J. Mathar, Jul 26 2022

EXAMPLE

The permutation 4,6,2,1,5,3 begins with three even numbers, so would contribute 3 to a(6).

a(3)=2 because in the permutations 123, 132, 213, 231, 312, 321 we have 0+0+1+1+0+0 = 2 leading odd entries.

a(45) = 16: Here are the permutations of 1234, 24 in all:

1(234) total 6, no. of initial even terms = 0

3(124) ditto

21(34) total 2, no. of initial even terms 1*2 = 2

23(14) ditto

24(13) total 2, no. of initial even terms 2 twice = 4

Subtotal from 2*** is 2+2+4 = 8

Subtotal from 4*** is also 2+2+4 = 8

Total a(4) = 8+8 = 16.

MAPLE

ao := proc (n) options operator, arrow; n*factorial(2*n+1)/(n+2) end proc: ae := proc (n) options operator, arrow; n*factorial(2*n)/(n+1) end proc: a := proc (n) if `mod`(n, 2) = 1 then ao((1/2)*n-1/2) else ae((1/2)*n) end if end proc; seq(a(n), n = 1 .. 20);

CROSSREFS

Cf. A152662, A152663, A152664.

Sequence in context: A207688 A208495 A207583 * A183762 A061608 A212899

Adjacent sequences: A152662 A152663 A152664 * A152666 A152667 A152668

KEYWORD

nonn

AUTHOR

Emeric Deutsch, Dec 13 2008

EXTENSIONS

Examples expanded by N. J. A. Sloane, Sep 09 2019

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 December 5 10:03 EST 2022. Contains 358585 sequences. (Running on oeis4.)