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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A306511 Number of permutations p of [n] having at least one index i with |p(i)-i| = 1. 2
0, 0, 1, 4, 19, 99, 603, 4248, 34115, 307875, 3085203, 33993870, 408482695, 5316309607, 74499953255, 1118421967520, 17907571955927, 304619809031127, 5486197279305911, 104289196264058030, 2086706157642260387, 43838287730208552691, 964790364323910060691 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

LINKS

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

Wikipedia, Permutation

FORMULA

a(n) = n! - A078480(n).

MAPLE

a:= proc(n) option remember; `if`(n<5, [0$2, 1, 4, 19][n+1],

      (2*(n^3-8*n^2+20*n-14)*a(n-1)-(n-4)*(n-1)*(n^2-5*n+7)*

       a(n-2)-(n-2)*(n^2-7*n+13)*a(n-3)+(n^4-12*n^3+53*n^2

       -102*n+71)*a(n-4)+(n-4)*(n^2-5*n+7)*a(n-5))/(n^2-7*n+13))

    end:

seq(a(n), n=0..23);

CROSSREFS

Column k=1 of A306506.

Cf. A000142, A078480, A180191.

Sequence in context: A047099 A211855 A327115 * A177249 A083882 A007564

Adjacent sequences:  A306508 A306509 A306510 * A306512 A306513 A306514

KEYWORD

nonn

AUTHOR

Alois P. Heinz, Feb 20 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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 18 18:23 EDT 2019. Contains 327178 sequences. (Running on oeis4.)