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 A296054 #16 Aug 30 2021 11:02:14 %S A296054 1,1,2,6,14,84,344,2714,15850,158664,1254536,15066332,151035364, %T A296054 2091499222,25438986270,398610118170,5712650790562,99963273184972, %U A296054 1649446030193764,31890910904182000,594935710367215600,12604160312187654888,262094375885982582488 %N A296054 Number of permutations of [n] with an equal number of occurrences of the consecutive step patterns 010 and 101, where 1=up and 0=down. %C A296054 a(n) * sqrt(n) / n! tends to 1.064409... - _Vaclav Kotesovec_, Aug 30 2021 %H A296054 Alois P. Heinz, <a href="/A296054/b296054.txt">Table of n, a(n) for n = 0..300</a> %e A296054 a(4) = 14: 1234, 1243, 1342, 1432, 2134, 2341, 2431, 3124, 3214, 3421, 4123, 4213, 4312, 4321 with step patterns 111, 110, 110, 100, 011, 110, 100, 011, 001, 100, 011, 001, 001, 000, respectively. %p A296054 b:= proc(u, o, t, h, c) option remember; `if`(2*abs(c)-1>u+o, 0, %p A296054 `if`(u+o=0, 1, `if`(t=0, add(b(u-j, j-1, 1$2, 0), j=1..u), %p A296054 add(b(u-j, o+j-1, [1, 3, 1][t], 2, c+`if`(h=3, 1, 0)), j=1..u)+ %p A296054 add(b(u+j-1, o-j, 2, [1, 3, 1][h], c-`if`(t=3, 1, 0)), j=1..o)))) %p A296054 end: %p A296054 a:= n-> b(n, 0$4): %p A296054 seq(a(n), n=0..30); %t A296054 b[u_, o_, t_, h_, c_] := b[u, o, t, h, c] = If[2 Abs[c] - 1 > u+o, 0, %t A296054 If[u+o == 0, 1, If[t == 0, Sum[b[u-j, j-1, 1, 1, 0], {j, u}], %t A296054 Sum[b[u-j, o+j-1, {1, 3, 1}[[t]], 2, c+If[h == 3, 1, 0]], {j, u}]+ %t A296054 Sum[b[u+j-1, o-j, 2, {1, 3, 1}[[h]], c-If[t == 3, 1, 0]], {j, o}]]]]; %t A296054 a[n_] := b[n, 0, 0, 0, 0]; %t A296054 Table[a[n], {n, 0, 30}] (* _Jean-François Alcover_, Aug 30 2021, after _Alois P. Heinz_ *) %Y A296054 Cf. A295974, A295987. %K A296054 nonn %O A296054 0,3 %A A296054 _Alois P. Heinz_, Dec 03 2017