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.

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

Original entry on oeis.org

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, 0, 1, 20, 38, 48, 113, 293, 154, 137, 183, 409, 78, 63, 54, 2, 0, 1, 27, 60, 87, 49, 227, 738, 883, 451, 457, 670, 2157, 1007, 1580, 79, 605, 1520, 384, 127, 116, 2, 0
Offset: 0

Views

Author

Peter Luschny, Aug 05 2022

Keywords

Examples

			[0] 0;
[1] 0;
[2] 1, 0;
[3] 1, 2, 0;
[4] 1, [5, 3], 2, 0;
[5] 1, [9, 12], [15,  10],   2,  0;
[6] 1, [14, 23, 12], [ 47,  94, 11], [31,   24],   2,  0;
[7] 1, [20, 38, 48], [113, 293, 154, 137], [183, 409, 78], [63, 54], 2, 0;
Summing the bracketed terms reduces the triangle to A356265.
		

Crossrefs

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

Programs

  • SageMath
    import collections
    def reducible(p) -> bool:  # p is a Sage-Permutation
        return any(i for i in range(1, p.size())
                      if all(p(j) < p(k)
                          for j in range(1, i + 1)
                              for k in range(i + 1, p.size() + 1) ) )
    def void(L) -> bool: return True
    def perm_red_stats(n: int, part_costraint, lehmer_constraint):
        res = collections.defaultdict(int)
        for p in Permutations(n):
            if not part_costraint(p): continue
            l: list[int] = p.to_lehmer_code()
            if lehmer_constraint(l):
                c: list[int] = [l.count(i) for i in range(len(p)) if i in l]
                res[Partition(reversed(sorted(c)))] += 1
        return sorted(res.items(), key=lambda x: len(x[0]))
    @cache
    def A356264_row(n: int) -> list[int]:
        if n < 2: return [0]
        return [v[1] for v in perm_red_stats(n, reducible, void)] + [0]
    def A356264(n: int, k: int) -> int:
        return A356264_row(n)[k]
    for n in range(0, 8): print(A356264_row(n))