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 A228422 #15 Dec 20 2020 07:37:54 %S A228422 0,0,0,0,1,14,164,1589,15034,139465,1334945,13108425,134906641, %T A228422 1443572465,16238742806,190546010823,2347715040542,30162115442344, %U A228422 405859441345002,5684963539755583,83163913991455832,1263763900212930657,20000260465018111763 %N A228422 Number of permutations of [n] with exactly two (possibly overlapping) occurrences of some of the consecutive patterns 123, 1432, 2431, 3421. %H A228422 Alois P. Heinz, <a href="/A228422/b228422.txt">Table of n, a(n) for n = 0..185</a> %F A228422 a(n) ~ c * (2/Pi)^n * n! * n^2, where c = 1.286210080518397686... . - _Vaclav Kotesovec_, Aug 28 2014 %e A228422 a(4) = 1: 1234. %e A228422 a(5) = 14: 12354, 12453, 12543, 13452, 13542, 14532, 21345, 23451, 23541, 24531, 31245, 34521, 41235, 51234. %p A228422 b:= proc(u, o, t, c) option remember; %p A228422 `if`(c<0, 0, `if`(u+o=0, `if`(c=0, 1, 0), %p A228422 add(b(u+j-1, o-j, [2, 2, 2][t], `if`(t=2, c-1, c)), j=1..o)+ %p A228422 add(b(u-j, o+j-1, [1, 3, 1][t], `if`(t=3, c-1, c)), j=1..u))) %p A228422 end: %p A228422 a:= n-> b(n, 0, 1, 2): %p A228422 seq(a(n), n=0..25); %t A228422 b[u_, o_, t_, c_] := b[u, o, t, c] = %t A228422 If[c<0, 0, If[u+o == 0, If[c == 0, 1, 0], %t A228422 Sum[b[u+j-1, o-j, 2, If[t == 2, c-1, c]], {j, 1, o}] + %t A228422 Sum[b[u-j, o+j-1, {1, 3, 1}[[t]], If[t == 3, c-1, c]], {j, 1, u}]]]; %t A228422 a[n_] := b[n, 0, 1, 2]; %t A228422 Table[a[n], {n, 0, 25}] (* _Jean-François Alcover_, Dec 20 2020, after _Alois P. Heinz_ *) %Y A228422 Column k=2 of A231210. %K A228422 nonn %O A228422 0,6 %A A228422 _Alois P. Heinz_, Nov 09 2013