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

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A209322 Number of derangements of [n] with no succession. 3
 1, 0, 1, 0, 4, 14, 102, 682, 5484, 49288, 492812, 5418154, 64993966, 844658714, 11822116868, 177292309424, 2836140479376, 48206588630826, 867597809813018, 16482372327022854, 329612875955466784, 6921235129197714036, 152254880756288024536, 3501612401180417830334 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,5 COMMENTS A derangement is a permutation with no fixed points. A succession of a permutation p is a position i such that p(i+1)-p(i) = 1. LINKS Table of n, a(n) for n=0..23. FORMULA a(n) = n! - A207819(n). EXAMPLE For n=4 we have 2143, 2413, 3142 and 4321, so a(4) = 4. MAPLE F:= proc(S) add(G(S minus {s}, s-1), s = S minus {nops(S)}) end proc: G:= proc(S, t) option remember; if S = {} then return 1 fi; add(procname(S minus {s}, s-1), s = S minus {t, nops(S)}) end proc: 1, seq(F({\$1..n}), n=1..19); # Robert Israel, Mar 02 2017 MATHEMATICA F[{}] = 1; F[S_] := Sum[G[S ~Complement~ {s}, s-1], {s, S ~Complement~ {Length[S]}}]; G[{}, _] = 1; G[S_, t_] := G[S, t] = Sum[G[S ~Complement~ {s}, s-1], {s, S ~Complement~ {t, Length[S]}}]; Table[a[n] = F[Range[n]]; Print[n, " ", a[n]]; a[n], {n, 0, 20}] (* Jean-François Alcover, Mar 05 2019, after Robert Israel *) CROSSREFS Cf. A000166, A002467, A180191, A207819, A207821, A209325, A209326. Sequence in context: A316414 A268689 A299199 * A110302 A282617 A005743 Adjacent sequences: A209319 A209320 A209321 * A209323 A209324 A209325 KEYWORD nonn AUTHOR Jon Perry, Jan 19 2013 EXTENSIONS a(11)-a(14) from Alois P. Heinz, Jan 19 2013 a(15)-a(20) from Robert Israel, Mar 02 2017 a(21)-a(23) from Alois P. Heinz, Jul 04 2021 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.

Last modified July 17 12:34 EDT 2024. Contains 374377 sequences. (Running on oeis4.)