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 A231410 #14 Mar 23 2021 16:12:57 %S A231410 6,11,29,99,367,1543,7901,41759,241361,1647843,11321131,83279563, %T A231410 710717285,6009605795,53680350389,549737059971,5519982252151, %U A231410 58008028652479,693065960525741,8057982367331159,97381078055591177,1329697914765988419,17567989325451095443 %N A231410 Number of permutations of [n] with exactly n-3 (possibly overlapping) occurrences of some of the consecutive step patterns UUD, UDU, DUU (U=up, D=down). %H A231410 Alois P. Heinz, <a href="/A231410/b231410.txt">Table of n, a(n) for n = 3..200</a> %e A231410 a(3) = 6: 123, 132, 213, 231, 312, 321. %e A231410 a(4) = 11: 1243, 1342, 2341 (UUD), 1324, 1423, 2314, 2413, 3412 (UDU), 2134, 3124, 4123 (DUU). %e A231410 a(5) = 29: 12435, 12534, 13245, ..., 51243, 51342, 52341. %e A231410 a(6) = 99: 124356, 125346, 126345, ..., 623514, 624513, 634512. %e A231410 a(7) = 367: 1243576, 1243675, 1253476, ..., 7346125, 7356124, 7456123. %p A231410 b:= proc(u, o, t, c) option remember; `if`(u+o<c, 0, %p A231410 `if`(u+o=0, `if`(c=0, 1, 0), %p A231410 add(b(u+j-1, o-j, [2, 3, 3, 6, 6, 3][t], %p A231410 `if`(t in [5, 6], c-1, c)), j=1..o)+ %p A231410 add(b(u-j, o+j-1, [4, 5, 5, 4, 4, 5][t], %p A231410 `if`(t=3, c-1, c)), j=1..u))) %p A231410 end: %p A231410 a:= n-> add(b(j-1, n-j, 1, n-3), j=1..n): %p A231410 seq(a(n), n=3..25); %t A231410 b[u_, o_, t_, c_] := b[u, o, t, c] = If[u + o < c, 0, %t A231410 If[u + o == 0, If[c == 0, 1, 0], %t A231410 Sum[b[u + j - 1, o - j, {2, 3, 3, 6, 6, 3}[[t]], %t A231410 If[5 <= t <= 6, c - 1, c]], {j, 1, o}] + %t A231410 Sum[b[u - j, o + j - 1, {4, 5, 5, 4, 4, 5}[[t]], %t A231410 If[t == 3, c - 1, c]], {j, 1, u}]]]; %t A231410 a[n_] := Sum[b[j - 1, n - j, 1, n - 3], {j, 1, n}]; %t A231410 a /@ Range[3, 25] (* _Jean-François Alcover_, Mar 23 2021, after _Alois P. Heinz_ *) %Y A231410 Diagonal of A231384. %K A231410 nonn %O A231410 3,1 %A A231410 _Alois P. Heinz_, Nov 08 2013