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!)
A014508 a(n) = floor( n! / e ). 2
0, 0, 2, 8, 44, 264, 1854, 14832, 133496, 1334960, 14684570, 176214840, 2290792932, 32071101048, 481066515734, 7697064251744, 130850092279664, 2355301661033952, 44750731559645106, 895014631192902120 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
Michael Penn, Always even., YouTube video, 2022.
R. Sedgewick, Permutation generation methods, Computing Surveys, 9 (1977), 137-164.
FORMULA
a(n) = Sum_{k=0..n-1} (n - k - 1)*A000166(n - k - 1). - Robert G. Wilson v, Apr 01 2011
a(n) = A000166(n) - (n mod 2). - Joerg Arndt, Apr 02 2011
E.g.f.: -exp(x)/2-(x+1)*exp(-x)/(2*x-2). - Mark van Hoeij, Oct 30 2011
MATHEMATICA
f[n_] := Floor[n!/E]; Array[f, 20] (* or *) a[0] = 1; a[n_] := a[n] = n*a[n - 1] + (-1)^n; f[n_] := Sum[(n - k - 1) a[n - k - 1], {k, 0, n - 1}]; Array[f, 20] (* Robert G. Wilson v, Apr 01 2011 *)
PROG
(PARI) vector(30, n, if(n, round(n!/exp(1)), 1)-(n+1)%2) \\ Altug Alkan, Nov 04 2015
CROSSREFS
Cf. A000166.
Sequence in context: A177260 A121747 A261266 * A141147 A346626 A201374
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
Sedgewick reference from N. J. A. Sloane, Mar 07 2008
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 April 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)