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!)
A207819 Number of permutations of [n] with a fixed point and/or a succession. 7
0, 1, 1, 6, 20, 106, 618, 4358, 34836, 313592, 3135988, 34498646, 414007634, 5382362086, 75356174332, 1130382058576, 18086649408624, 307480839465174, 5534775895914982, 105162728081809146, 2103289132221173216, 44169707042511725964, 971745847021319655464, 22350404337704558809666 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
COMMENTS
A succession of a permutation p is the appearance of [k,k+1], e.g. in 23541, 23 is a succession.
LINKS
FORMULA
a(n) = n! - A209322(n). - Robert Israel, Mar 27 2017
EXAMPLE
For n=4 the only permutations that do not count are 2143, 2413, 3142 and 4321, so a(4) = 4!-4 = 20.
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] = n! - F[Range[n]]; Print[n, " ", a[n]]; a[n], {n, 0, 20}] (* Jean-François Alcover, Mar 05 2019, using Robert Israel's code for A209322 *)
PROG
(PARI) A207819(n)={my(p, c); sum(k=1, n!, p=numtoperm(n, k); (c=(p[1]==1)) || for(j=2, n, p[j]!=j & p[j]-1!=p[j-1] & next; c++; break); c)} \\ M. F. Hasler, Jan 13 2013
CROSSREFS
Sequence in context: A238118 A211953 A266846 * A297974 A280187 A151493
KEYWORD
nonn
AUTHOR
Jon Perry, Jan 10 2013
EXTENSIONS
Values a(1..10) double-checked by M. F. Hasler, Jan 13 2013
a(11)-a(14) from Alois P. Heinz, Jan 15 2013
a(15)-a(20) from Robert Israel, Mar 27 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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 06:57 EDT 2024. Contains 371265 sequences. (Running on oeis4.)