login
A356324
a(n) is the first split point of the permutation p if p is the n-th permutation (in lexicographic order (A030298 prepended by the empty permutation)), or zero if it has no split point.
0
0, 0, 1, 0, 1, 1, 2, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 3, 0, 0, 0, 3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 4, 0, 0, 0, 4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 4, 0, 0
OFFSET
0,7
COMMENTS
A permutation p in [n] (where n >= 0) is reducible if there exist an i in 1..n-1 such that for all j in the range 1..i and all k in the range i+1..n it is true that p(j) < p(k). (Note that a range a..b includes a and b.) If such an i exists we say that i splits the permutation p at i and that i is a split point of p.
The list of permutations starts with the empty permutation (), which has no split points. The first permutation which has a split point is (1, 2).
The number of terms corresponding to the permutations of [n] which vanish is A003319(n), and the numbers of nonzero terms is A356291(n).
EXAMPLE
Rows give the terms corresponding to the permutations of [n].
[0] [0]
[1] [0]
[2] [1, 0]
[3] [1, 1, 2, 0, 0, 0]
[4] [1, 1, 1, 1, 1, 1, 2, 2, 3, 0, 0, 0, 3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0]
PROG
(SageMath)
def FirstSplit(p) -> int:
n = p.size()
for i in (1..n-1):
ok = True
for j in (1..i):
if not ok: break
for k in (i + 1..n):
if p(j) > p(k):
ok = False
break
if ok: return i
return 0
def A356324_row(n): return [FirstSplit(p) for p in Permutations(n)]
for n in range(6): print(A356324_row(n))
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Peter Luschny, Aug 03 2022
STATUS
approved