login
Partition triangle read by rows, counting reducible permutations, refining triangle A356265.
4

%I #11 Aug 23 2022 05:34:56

%S 0,0,1,0,1,2,0,1,5,3,2,0,1,9,12,15,10,2,0,1,14,23,12,47,94,11,31,24,2,

%T 0,1,20,38,48,113,293,154,137,183,409,78,63,54,2,0,1,27,60,87,49,227,

%U 738,883,451,457,670,2157,1007,1580,79,605,1520,384,127,116,2,0

%N Partition triangle read by rows, counting reducible permutations, refining triangle A356265.

%H Peter Luschny, <a href="https://github.com/PeterLuschny/PermutationsWithLehmer/blob/main/PermutationsWithLehmer.ipynb">Permutations with Lehmer</a>, a SageMath Jupyter Notebook.

%e [0] 0;

%e [1] 0;

%e [2] 1, 0;

%e [3] 1, 2, 0;

%e [4] 1, [5, 3], 2, 0;

%e [5] 1, [9, 12], [15, 10], 2, 0;

%e [6] 1, [14, 23, 12], [ 47, 94, 11], [31, 24], 2, 0;

%e [7] 1, [20, 38, 48], [113, 293, 154, 137], [183, 409, 78], [63, 54], 2, 0;

%e Summing the bracketed terms reduces the triangle to A356265.

%o (SageMath)

%o import collections

%o def reducible(p) -> bool: # p is a Sage-Permutation

%o return any(i for i in range(1, p.size())

%o if all(p(j) < p(k)

%o for j in range(1, i + 1)

%o for k in range(i + 1, p.size() + 1) ) )

%o def void(L) -> bool: return True

%o def perm_red_stats(n: int, part_costraint, lehmer_constraint):

%o res = collections.defaultdict(int)

%o for p in Permutations(n):

%o if not part_costraint(p): continue

%o l: list[int] = p.to_lehmer_code()

%o if lehmer_constraint(l):

%o c: list[int] = [l.count(i) for i in range(len(p)) if i in l]

%o res[Partition(reversed(sorted(c)))] += 1

%o return sorted(res.items(), key=lambda x: len(x[0]))

%o @cache

%o def A356264_row(n: int) -> list[int]:

%o if n < 2: return [0]

%o return [v[1] for v in perm_red_stats(n, reducible, void)] + [0]

%o def A356264(n: int, k: int) -> int:

%o return A356264_row(n)[k]

%o for n in range(0, 8): print(A356264_row(n))

%Y Cf. A356265 (reduced), A356262, A356263, A356291 (row sums).

%K nonn,tabf

%O 0,6

%A _Peter Luschny_, Aug 05 2022