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 A295974 #26 Dec 28 2017 07:56:22 %S A295974 1,1,2,6,14,52,204,1010,5466,34090,233026,1765836,14534404,129916550, %T A295974 1248875862,12872804422,141470905326,1652327596652,20430973234388, %U A295974 266683791698634,3664052636652962,52859944626536554,798893924217099426,12622926284124944660 %N A295974 Number of length-n permutations avoiding descent patterns aba and bab. %C A295974 The descent pattern of a permutation is the sign of the first difference of the permutation, with "a" denoting a rise (+1) and "b" denoting a descent (-1). For example, the permutation 364125 has descent pattern abbaa. %H A295974 Alois P. Heinz, <a href="/A295974/b295974.txt">Table of n, a(n) for n = 0..479</a> %H A295974 Richard Ehrenborg and JiYoon Jung, <a href="https://doi.org/10.1016/j.aam.2012.08.004">Descent pattern avoidance</a>, Adv. Appl. Math. 49 (3-5) (2012), 375-390. %H A295974 Richard Ehrenborg and JiYoon Jung, <a href="https://arxiv.org/abs/1312.2027">Descent pattern avoidance</a>, arXiv preprint:1312.2027 [math.CO], 6 Dec 2013. %F A295974 Ehrenborg and Jung prove that a(n) ~ 0.8908970548...*(0.6869765032...)^(n-3)*n!. %e A295974 For n = 4 the 10 permutations NOT counted are 1324, 1423, 2143, 2314, 2413, 3142, 3241, 3412, 4132, 4231. %p A295974 b:= proc(u, o, t, h) option remember; %p A295974 `if`(u+o=0, 1, `if`(t=0, add(b(u-j, j-1, 1$2), j=1..u), %p A295974 add(`if`(h=3, 0, b(u-j, o+j-1, [1, 3, 1][t], 2)), j=1..u)+ %p A295974 add(`if`(t=3, 0, b(u+j-1, o-j, 2, [1, 3, 1][h])), j=1..o))) %p A295974 end: %p A295974 a:= n-> b(n, 0$3): %p A295974 seq(a(n), n=0..30); # _Alois P. Heinz_, Dec 01 2017 %t A295974 b[u_, o_, t_, h_] := b[u, o, t, h] = If[u + o == 0, 1, If[t == 0, Sum[b[u - j, j - 1, 1, 1], {j, 1, u}], Sum[If[h == 3, 0, b[u - j, o + j - 1, {1, 3, 1}[[t]], 2]], {j, 1, u}] + Sum[If[t == 3, 0, b[u + j - 1, o - j, 2, {1, 3, 1}[[h]]]], {j, 1,o}]]]; %t A295974 a[n_] := b[n, 0, 0, 0]; %t A295974 Table[a[n], {n, 0, 30}] (* _Jean-François Alcover_, Dec 28 2017, after _Alois P. Heinz_ *) %Y A295974 Column k=0 of A295987. %Y A295974 Cf. A296054. %K A295974 nonn %O A295974 0,3 %A A295974 _Jeffrey Shallit_, Dec 01 2017 %E A295974 a(13)-a(23) from _Alois P. Heinz_, Dec 01 2017