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!)
A207821 Number of permutations of [n] that either have a fixed point or a succession, but not both. 7
0, 1, 0, 5, 12, 69, 370, 2609, 20552, 183249, 1817794, 19867793, 237126320, 3068483277, 42788761294, 639619513669, 10202914060472, 172984071549421, 3106257794721534, 58892020126278457, 1175554242034515780 (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
EXAMPLE
a(4) = 12 because we have 1324, 1432, 2341, 2431, 3214, 3241, 3412, 3421, 4123, 4132, 4213 and 4312.
PROG
(PARI) A207821(n)=my(p, c); sum(k=1, n!, p=numtoperm(n, k); c=(p[1]==1); for(j=2, n, p[j]==j & c<=0 & !c++ & break; p[j]-1==p[j-1] & c>=0 & !c-- & break); c!=0) \\ - M. F. Hasler, Jan 13 2013
CROSSREFS
Sequence in context: A246176 A009413 A009429 * A297644 A242043 A156236
KEYWORD
nonn,more
AUTHOR
Jon Perry, Jan 10 2013
EXTENSIONS
Values a(1) to a(10) double-checked by M. F. Hasler, Jan 13 2013
Inserted a(0) and a(11)-a(13) from Alois P. Heinz, Jan 18 2013
a(14)-a(20) from Alois P. Heinz, Jul 05 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 April 13 01:50 EDT 2024. Contains 371639 sequences. (Running on oeis4.)