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 A303160 #12 Aug 31 2021 07:42:02 %S A303160 1,1,1,3,7,43,148,1344,6171,74211,425976,6384708,43979902,789649750, %T A303160 6346283560,132789007200,1219725741715,29145283614115,301190499710320, %U A303160 8092186932120060,92921064554444490,2772830282722806978,35025128774218944648,1149343084932146388144 %N A303160 Number of permutations p of [n] such that 0p has exactly ceiling(n/2) alternating runs. %H A303160 Alois P. Heinz, <a href="/A303160/b303160.txt">Table of n, a(n) for n = 0..456</a> %F A303160 a(n) = A186370(n,ceiling(n/2)). %e A303160 a(2) = 1: 12. %e A303160 a(3) = 3: 132, 231, 321. %e A303160 a(4) = 7: 1243, 1342, 1432, 2341, 2431, 3421, 4321. %p A303160 b:= proc(n, k) option remember; `if`(k=0, %p A303160 `if`(n=0, 1, 0), `if`(k<0 or k>n, 0, %p A303160 k*b(n-1, k)+b(n-1, k-1)+(n-k+1)*b(n-1, k-2))) %p A303160 end: %p A303160 a:= n-> b(n, ceil(n/2)): %p A303160 seq(a(n), n=0..25); %t A303160 b[n_, k_] := b[n, k] = If[k == 0, %t A303160 If[n == 0, 1, 0], If[k < 0 || k > n, 0, %t A303160 k*b[n-1, k] + b[n-1, k-1] + (n-k+1)*b[n-1, k-2]]]; %t A303160 a[n_] := b[n, Ceiling[n/2]]; %t A303160 Table[a[n], {n, 0, 25}] (* _Jean-François Alcover_, Aug 31 2021, after _Alois P. Heinz_ *) %Y A303160 Bisections give: A291677 (even part), A303159 (odd part). %Y A303160 Cf. A186370. %K A303160 nonn %O A303160 0,4 %A A303160 _Alois P. Heinz_, Apr 19 2018