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!)
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
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);
MATHEMATICA
a[n_] := n! - Sum[Sum[(-1)^k (i-k)! Binomial[2i-k, k], {k, 0, i}],
{i, 0, n}];
a /@ Range[0, 23] (* Jean-François Alcover, May 03 2021, after Vaclav Kotesovec in A078480 *)
CROSSREFS
Column k=1 of A306506.
Sequence in context: A211855 A327115 A370024 * A177249 A083882 A007564
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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 09:59 EDT 2024. Contains 371268 sequences. (Running on oeis4.)