A201452 Number of permutations of [n] with both a fixed point and a succession.
0, 0, 1, 1, 8, 37, 248, 1749, 14284, 130343, 1318194, 14630853, 176881314, 2313878809, 32567413038, 490762544907, 7883735348152, 134496767915753, 2428518101193448, 46270707955530689, 927734890186657436
Offset: 0
Examples
a(4) = 8 because we have 1234, 1243, 1342, 1423, 2134, 2314, 3124 and 4231.
Programs
-
PARI
A201452(n)=my(p,c);sum(k=1,n!,p=numtoperm(n,k);c=(p[1]==1);for(j=2,n,p[j]==j&c!=1&c++==3&break;p[j]-1==p[j-1]&c!=2&(c+=2)==3&break);c==3) \\ - M. F. Hasler, Jan 13 2013
Extensions
Values a(1..10) double-checked by M. F. Hasler, Jan 13 2013
a(11)-a(13) from Alois P. Heinz, Jan 18 2013
a(14)-a(20) from Alois P. Heinz, Jul 06 2021
Comments