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 A230797 #23 Dec 01 2017 17:41:24 %S A230797 1,1,2,6,24,104,16,528,192,3296,1472,272,23168,12800,4352,179712, %T A230797 132352,42880,7936,1573632,1366016,530432,158720,15207424,14781952, %U A230797 7662336,1911296,353792,158880768,178102272,101713920,31813632,8491008,1801996288,2282645504 %N A230797 Number T(n,k) of permutations of [n] with exactly k (possibly overlapping) occurrences of the consecutive step pattern up, down, up, down; triangle T(n,k), n>=0, 0<=k<=max(0,floor((n-3)/2)), read by rows. %H A230797 Alois P. Heinz, <a href="/A230797/b230797.txt">Rows n = 0..170, flattened</a> %e A230797 T(5,1) = 16: 13254, 14253, 14352, 15243, 15342, 23154, 24153, 24351, 25143, 25341, 34152, 34251, 35142, 35241, 45132, 45231. %e A230797 T(7,2) = 272: 1325476, 1326475, 1326574, ..., 6735241, 6745132, 6745231. %e A230797 Triangle T(n,k) begins: %e A230797 : 0 : 1; %e A230797 : 1 : 1; %e A230797 : 2 : 2; %e A230797 : 3 : 6; %e A230797 : 4 : 24; %e A230797 : 5 : 104, 16; %e A230797 : 6 : 528, 192; %e A230797 : 7 : 3296, 1472, 272; %e A230797 : 8 : 23168, 12800, 4352; %e A230797 : 9 : 179712, 132352, 42880, 7936; %e A230797 : 10 : 1573632, 1366016, 530432, 158720; %p A230797 b:= proc(u, o, t) option remember; `if`(u+o=0, 1, expand( %p A230797 add(b(u-j, o+j-1, [1, 3, 1, 3][t])*`if`(t=4, x, 1), j=1..u)+ %p A230797 add(b(u+j-1, o-j, [2, 2, 4, 2][t]), j=1..o))) %p A230797 end: %p A230797 T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0, 1)): %p A230797 seq(T(n), n=0..15); # _Alois P. Heinz_, Oct 30 2013 %t A230797 b[u_, o_, t_] := b[u, o, t] = If[u+o == 0, 1, Expand[Sum[b[u-j, o+j-1, {1, 3, 1, 3}[[t]]]*If[t == 4, x, 1], {j, 1, u}] + Sum[b[u+j-1, o-j, {2, 2, 4, 2}[[t]]], {j, 1, o}]]]; T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][b[n, 0, 1]]; Table[T[n], {n, 0, 15}] // Flatten (* _Jean-François Alcover_, Oct 24 2016, after _Alois P. Heinz_ *) %Y A230797 Columns k=0-2 give: A177520, A230832, A264077. %Y A230797 T(2n-1,n-2) gives A000182(n) for n>=3. %Y A230797 Row sums give: A000142. %Y A230797 Cf. A242783, A242784, A295987. %K A230797 nonn,tabf %O A230797 0,3 %A A230797 _Alois P. Heinz_, Oct 30 2013