This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A207819 #44 Apr 04 2025 01:17:04 %S A207819 0,1,1,6,20,106,618,4358,34836,313592,3135988,34498646,414007634, %T A207819 5382362086,75356174332,1130382058576,18086649408624,307480839465174, %U A207819 5534775895914982,105162728081809146,2103289132221173216,44169707042511725964,971745847021319655464,22350404337704558809666,536415027665581568375190,13410494347081333360291850 %N A207819 Number of permutations of [n] with a fixed point and/or a succession. %C A207819 A succession of a permutation p is the appearance of [k,k+1], e.g. in 23541, 23 is a succession. %H A207819 Max Alekseyev, <a href="/A207819/b207819.txt">Table of n, a(n) for n = 0..30</a> %F A207819 a(n) = n! - A209322(n). - _Robert Israel_, Mar 27 2017 %e A207819 For n=4 the only permutations that do not count are 2143, 2413, 3142 and 4321, so a(4) = 4!-4 = 20. %t A207819 F[{}] = 1; F[S_] := Sum[G[S ~Complement~ {s}, s-1], {s, S ~Complement~ {Length[S]}}]; %t A207819 G[{}, _] = 1; G[S_, t_] := G[S, t] = Sum[G[S ~Complement~ {s}, s-1], {s, S ~Complement~ {t, Length[S]}}]; %t A207819 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 *) %o A207819 (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 %Y A207819 Cf. A000166, A002467, A180191, A201452, A207821, A209322. %K A207819 nonn %O A207819 0,4 %A A207819 _Jon Perry_, Jan 10 2013 %E A207819 Values a(1..10) double-checked by _M. F. Hasler_, Jan 13 2013 %E A207819 a(11)-a(14) from _Alois P. Heinz_, Jan 15 2013 %E A207819 a(15)-a(20) from _Robert Israel_, Mar 27 2017 %E A207819 a(21)-a(23) from _Alois P. Heinz_, Jul 04 2021 %E A207819 Terms a(24) onward from _Max Alekseyev_, Apr 03 2025