cp's OEIS Frontend

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.

A373877 Triangle read by rows: T(n, k) is the number of permutations of length n, which contain the maximum number of distinct patterns of length k.

This page as a plain text file.
%I A373877 #26 Jun 22 2024 04:47:58
%S A373877 1,2,2,6,4,6,24,22,2,24,120,118,2,14,120,720,718,218,8,90,720,5040,
%T A373877 5038,3070,24,2,646,5040,40320,40318,32972,64,28,20,5242,40320,362880,
%U A373877 362878,336196,3704,4,4,158,47622,362880,3628800,3628798,3533026,325752,16,16,16,1960,479306,3628800,39916800,39916798,39574122
%N A373877 Triangle read by rows: T(n, k) is the number of permutations of length n, which contain the maximum number of distinct patterns of length k.
%C A373877 Let P be a permutation of the set {1, 2, ..., n}. We consider all subsequences from P of length k and count the different permutation patterns obtained. T(n, k) is the number of permutations with the greatest count among all P.
%C A373877 A373778 gives the greatest count found.
%C A373877 Statistical results show that the maximum number of patterns occurs among the permutations that, when represented as a 2D pointset, maximize the average distance between neighboring points.
%C A373877 Column k gives the number of k-good permutations defined in A124188 for all rows where A373778(n, k) = k!.
%F A373877 T(n, 1) = n!.
%F A373877 T(n, n) = n!.
%F A373877 T(n, 2) = n! - 2, for n > 2.
%F A373877 T(n, 3) = A124188(n), for n > 4.
%F A373877 T(n, n-1) = A002464(n), for n > 3.
%e A373877 The triangle begins:
%e A373877    n| k:     1|     2|     3|  4|   5|   6|    7|     8
%e A373877   =====================================================
%e A373877   [1]        1
%e A373877   [2]        2,     2,
%e A373877   [3]        6,     4,     6,
%e A373877   [4]       24,    22,     2, 24
%e A373877   [5]      120,   118,     2, 14, 120
%e A373877   [6]      720,   718,   218,  8,  90, 720
%e A373877   [7]     5040,  5038,  3070, 24,   2, 646, 5040
%e A373877   [8]    40320, 40318, 32972, 64,  28,  20, 5242, 40320
%e A373877   ...
%e A373877 T(3, 2) = 4 because we have:
%e A373877   permutations  subsequences      patterns            number of patterns
%e A373877   {1,2,3} : {1,2},{1,3},{2,3} : [1,2],[1,2],[1,2] :  1.
%e A373877   {1,3,2} : {1,3},{1,2},{3,2} : [1,2],[1,2],[2,1] :  2 is a winner.
%e A373877   {2,1,3} : {2,1},{2,3},{1,3} : [2,1],[1,2],[1,2] :  2 is a winner.
%e A373877   {2,3,1} : {2,3},{2,1},{3,1} : [1,2],[2,1],[2,1] :  2 is a winner.
%e A373877   {3,1,2} : {3,1},{3,2},{1,2} : [2,1],[2,1],[1,2] :  2 is a winner.
%e A373877   {3,2,1} : {3,2},{3,1},{2,1} : [2,1],[2,1],[2,1] :  1.
%e A373877 A pattern is a set of indices that may sort a selected subsequence into an increasing sequence.
%o A373877 (PARI) row(n) = my(rowp = vector(n!, i, numtoperm(n, i)), v = vector(n), t = vector(n)); for (j=1, n, for (i=1, #rowp, my(r = rowp[i], list = List()); forsubset([n, j], s, my(ss = Vec(s)); vp = vector(j, ik, r[ss[ik]]); vs = Vec(vecsort(vp, , 1)); listput(list, vs); ); if( v[j] < #Set(list), v[j] = #Set(list); t[j] = 1, if(v[j] == #Set(list), t[j] = t[j]+1)); ); ); t;
%Y A373877 Cf. A002464, A124188, A342474, A373778.
%K A373877 nonn,tabl,hard
%O A373877 1,2
%A A373877 _Thomas Scheuerle_, Jun 20 2024