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 A092583 #21 Sep 08 2022 08:45:13 %S A092583 1,0,2,0,1,5,0,4,6,14,0,20,30,28,42,0,120,180,168,120,132,0,840,1260, %T A092583 1176,840,495,429,0,6720,10080,9408,6720,3960,2002,1430,0,60480,90720, %U A092583 84672,60480,35640,18018,8008,4862,0,604800,907200,846720,604800,356400,180180,80080,31824,16796 %N A092583 Triangle read by rows: T(n,k) is the number of permutations p of [n] in which the length of the longest initial segment avoiding the 123-pattern is equal to k. %C A092583 Row sums are the factorial numbers (A000142). %C A092583 Diagonal is A000108. %C A092583 T(n,n-1) = binomial(2n-2,n-3) = A002694(n-1). %H A092583 G. C. Greubel, <a href="/A092583/b092583.txt">Rows n = 1..100 of triangle, flattened</a> %H A092583 E. Deutsch and W. P. Johnson, <a href="http://www.jstor.org/stable/3219101">Create your own permutation statistics</a>, Math. Mag., 77, 130-134, 2004. %H A092583 R. Simion and F. W. Schmidt, <a href="https://doi.org/10.1016/S0195-6698(85)80052-4">Restricted permutations</a>, European J. Combin., 6, 383-406, 1985. %F A092583 T(n,k) = n!*binomial(2k, k-2)/(k+1)! for k < n; %F A092583 T(n,n) = binomial(2n, n)/(n+1) = A000108(n). %e A092583 T(4,3) = 6 because 1324, 1423, 2134, 2314, 3124 and 4123 are the only permutations of [4] in which the length of the longest initial segment avoiding the 123-pattern is equal to 3 (i.e., the first three entries do not contain the 123-pattern but all 4 of them do). %e A092583 Triangle starts: %e A092583 1; %e A092583 0, 2; %e A092583 0, 1, 5; %e A092583 0, 4, 6, 14; %e A092583 0, 20, 30, 28, 42; %e A092583 0, 120, 180, 168, 120, 132; %e A092583 0, 840, 1260, 1176, 840, 495, 429; %e A092583 ... %t A092583 T[n_,k_]:= If[k==n, CatalanNumber[n], n!*Binomial[2*k,k-2]/(k+1)!]; Table[T[n,k], {n,12}, {k,n}]//Flatten (* _G. C. Greubel_, Jul 22 2019 *) %o A092583 (PARI) tabl(nn) = {for (n=1, nn, for (k=1, n-1, print1(n!*binomial(2*k, k-2)/(k+1)!, ", ");); print1(binomial(2*n, n)/(n+1), ", "); print(););} \\ _Michel Marcus_, Jul 16 2013 %o A092583 (Magma) %o A092583 T:= func< n,k | k eq n select Catalan(n) else Factorial(n)*Binomial(2*k, k-2)/Factorial(k+1) >; %o A092583 [T(n,k): k in [1..n], n in [1..12]]; // _G. C. Greubel_, Jul 22 2019 %o A092583 (Sage) %o A092583 def T(n, k): %o A092583 if (k==n): return catalan_number(n) %o A092583 else: return factorial(n)*binomial(2*k, k-2)/factorial(k+1) %o A092583 [[T(n,k) for k in (1..n)] for n in (1..12)] # _G. C. Greubel_, Jul 22 2019 %o A092583 (GAP) %o A092583 T:= function(n,k) %o A092583 if k=n then return Binomial(2*n, n)/(n + 1); %o A092583 else return Factorial(n)*Binomial(2*k, k-2)/Factorial(k+1); %o A092583 fi; %o A092583 end; %o A092583 Flat(List([1..12], n-> List([1..n], k-> T(n,k) ))); # _G. C. Greubel_, Jul 22 2019 %Y A092583 Cf. A000142, A000108, A002694. %K A092583 nonn,tabl %O A092583 1,3 %A A092583 _Emeric Deutsch_ and Warren P. Johnson (wjohnson(AT)bates.edu), Apr 10 2004