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 A342840 #34 Feb 16 2025 08:34:01 %S A342840 1,1,2,6,23,1,103,10,6,1,512,77,69,30,21,5,6,2740,548,598,330,335,123, %T A342840 174,58,58,37,26,3,9,1,15485,3799,4686,2970,3411,1676,2338,1040,1317, %U A342840 878,777,363,608,230,252,165,133,30,93,26,31,4,1,3,4,91245,26165,35148,24550,30182,17185,24685,12976,16867,12248,12360,7203,11086,5692,6391,5194,5006,2751,3917,2019,2482,1622,1371,812,1233,490,495,416,360,157,282,54,78,41,29,22,49,7,4,0,6 %N A342840 Irregular triangle: T(n,k) is the number of permutations in S_n that have exactly k occurrences of the pattern 4213. 0 <= k <= A342646(n). %C A342840 The sequence is the same for the patterns 1342, 2431, and 3124. %C A342840 The sequence appears to be the same for the patterns 1423, 2314, 3241, and 4132. %C A342840 First column is given by A022558. Row sums given by n!. %H A342840 Peter Kagey, <a href="/A342840/b342840.txt">Rows n = 0..13, flattened</a>, based on Anders Kaseorg's Rust program at the Code Golf Stack Exchange link. %H A342840 FindStat, <a href="http://www.findstat.org/StatisticsDatabase/St000750">St000750: The number of occurrences of the pattern 4213 in a permutation.</a> %H A342840 Anders Kaseorg, <a href="https://codegolf.stackexchange.com/a/222494/53884">Answer: Patterns in Permutations</a>, Code Golf Stack Exchange. %H A342840 Rob Pratt, <a href="https://math.stackexchange.com/a/4071338/121988">Greatest number of occurrences of the pattern 4213 in a permutation</a>, Mathematics Stack Exchange. %H A342840 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PermutationPattern.html">Permutation Pattern</a> %e A342840 Triangle begins: %e A342840 n\k | 0 1 2 3 4 5 6 7 8 9 10 11 12 13 %e A342840 ----+------------------------------------------------------------- %e A342840 0 | 1; %e A342840 1 | 1; %e A342840 2 | 2; %e A342840 3 | 6; %e A342840 4 | 23, 1; %e A342840 5 | 103, 10, 6, 1; %e A342840 6 | 512, 77, 69, 30, 21, 5, 6; %e A342840 7 | 2740, 548, 598, 330, 335, 123, 174, 58, 58, 37, 26, 3, 9, 1; %t A342840 Join@@Array[Table[Length@Select[Permutations@Range@#,Length@Select[Subsets[#,{4}],Ordering@Ordering@#=={4,2,1,3}&]==k&],{k,0,Binomial[n+1,4]}]//.{a__,0}:>{a}&,8,0] (* _Giorgos Kalogeropoulos_, Mar 25 2021 *) %Y A342840 Cf. A022558, A342646. %Y A342840 Cf. A263771 (analogous for 312). %K A342840 nonn,tabf %O A342840 0,3 %A A342840 _Peter Kagey_, Mar 24 2021