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 A306524 #14 Oct 31 2021 13:46:21 %S A306524 0,0,0,3,15,86,544,3934,32079,292509,2952702,32712087,394749367, %T A306524 5155010088,72440184064,1090017765544,17486996858151,297965879586295, %U A306524 5374189975316350,102290550351854445,2049025241258716927,43089888746430771294,949172134240270646352 %N A306524 Number of permutations p of [n] having at least one index i with |p(i)-i| = 2. %H A306524 Alois P. Heinz, <a href="/A306524/b306524.txt">Table of n, a(n) for n = 0..450</a> %H A306524 Wikipedia, <a href="https://en.wikipedia.org/wiki/Permutation">Permutation</a> %F A306524 a(n) = n! - A306523(n). %e A306524 a(3) = 3: 231, 312, 321. %e A306524 a(4) = 15: 1342, 1423, 1432, 2314, 2413, 2431, 3124, 3142, 3214, 3241, 3412, 3421, 4132, 4213, 4312. %t A306524 T[n_, k_] := n! - Permanent[Table[If[Abs[i-j] == k, 0, 1], {i, 1, n}, {j, 1, n}]]; %t A306524 a[n_] := If[n == 0, 0, T[n, 2]]; %t A306524 Table[Print[n, " ", a[n]]; a[n], {n, 0, 23}] (* _Jean-François Alcover_, Oct 31 2021, after _Alois P. Heinz_ in A306506 *) %Y A306524 Column k=2 of A306506. %Y A306524 Cf. A000142, A306523. %K A306524 nonn %O A306524 0,4 %A A306524 _Alois P. Heinz_, Feb 21 2019