Skip to content

NonCrossingCycleSupportPermutations ​

The permutations of {1,…,n}\{1, …, n\} whose cycles, read as a set partition of {1,…,n}\{1, …, n\}, form a non-crossing partition — cycles may hold their elements in any cyclic order — as a lazy indexed family.

NonCrossingCycleSupportPermutations(n)the permutations of {1,…,n}\{1, …, n\} whose cycles are a non-crossing set partition.
Typed signatures
TypePackageApplies
(integer<0..>) -> indexed_collection<permutation>combinatoricsalways

Domain: Collections

Details
  • A lazy indexed collection; the count follows a verified recurrence on the block containing 11 — 1,2,6,23,105,…1, 2, 6, 23, 105, … — with no OEIS match confirmed for this reading, so none is cited.
  • Cyclic order within a block is unconstrained. Requiring each cycle's elements to increase (the interval [e,(1 2 … n)][e, (1\,2\,…\,n)] in absolute order) gives the standard noncrossing permutations, NonCrossingPermutations, counted by the Catalan numbers 1,2,5,14,…1, 2, 5, 14, …
  • Each element is the one-line word; AtAt enumerates all n!n! permutations in lexicographic order and indexes into those whose cycles are non-crossing.

Definition

Epsil, as the implementation runs it.

count(_n)

Apply((prefix: list<integer>) => Apply((filled: integer) => 1 if _n == 0 else Apply(
                                                                                     (ncc: list<integer>) => Apply(
                                                                                                                    (nclo: list<integer>) => Apply(
                                                                                                                                                    (nchi: list<integer>) => Apply(
                                                                                                                                                                                    (ncl: list<integer>) => Apply(
                                                                                                                                                                                                                   (ncf: list<integer>) => 1 if 1 > _n else ncf[(_n - 1) *
                                                                                                                                                                                                                                                                _n +
                                                                                                                                                                                                                                                                _n] if ncl[(1 - 1) *
                                                                                                                                                                                                                                                                         _n +
                                                                                                                                                                                                                                                                         _n] ==
                                                                                                                                                                                                                                                                     1 else 0,
                                                                                                                                                                                                                   Fold(Function(Apply((nci: integer) => Apply(
                                                                                                                                                                                                                                                                (ncd: list<integer>) => Apply(
                                                                                                                                                                                                                                                                                               (ncw: list<integer>) => Join(
                                                                                                                                                                                                                                                                                                                             ncf,
                                                                                                                                                                                                                                                                                                                             Fold(Function(ReplaceAt(
                                                                                                                                                                                                                                                                                                                                                      ncj_l,
                                                                                                                                                                                                                                                                                                                                                      ncj - 1 +
                                                                                                                                                                                                                                                                                                                                                      1,
                                                                                                                                                                                                                                                                                                                                                      0 if ncj < nci ||
                                                                                                                                                                                                                                                                                                                                                           ncl[(nci - 1) *
                                                                                                                                                                                                                                                                                                                                                               _n +
                                                                                                                                                                                                                                                                                                                                                               ncj] ==
                                                                                                                                                                                                                                                                                                                                                           0 else Apply(
                                                                                                                                                                                                                                                                                                                                                                        (ncg: list<integer>) => ncg[1] *
                                                                                                                                                                                                                                                                                                                                                                                                (1 if nchi[nci] + 1 >
                                                                                                                                                                                                                                                                                                                                                                                                      ncj else ncf[(_n -
                                                                                                                                                                                                                                                                                                                                                                                                                 (nchi[nci] + 1)) *
                                                                                                                                                                                                                                                                                                                                                                                                                _n +
                                                                                                                                                                                                                                                                                                                                                                                                                ncj] if ncl[(nchi[nci] + 1 -
                                                                                                                                                                                                                                                                                                                                                                                                                          1) *
                                                                                                                                                                                                                                                                                                                                                                                                                         _n +
                                                                                                                                                                                                                                                                                                                                                                                                                         ncj] ==
                                                                                                                                                                                                                                                                                                                                                                                                                     1 else 0),
                                                                                                                                                                                                                                                                                                                                                                        Fold(Function([ncg_[1] *
                                                                                                                                                                                                                                                                                                                                                                                       (1 if ncg_[2] + 1 >
                                                                                                                                                                                                                                                                                                                                                                                             ncx - 1 else ncf[(_n -
                                                                                                                                                                                                                                                                                                                                                                                                        (ncg_[2] + 1)) *
                                                                                                                                                                                                                                                                                                                                                                                                       _n +
                                                                                                                                                                                                                                                                                                                                                                                                       (ncx - 1)] if ncl[(ncg_[2] + 1 -
                                                                                                                                                                                                                                                                                                                                                                                                                 1) *
                                                                                                                                                                                                                                                                                                                                                                                                                _n +
                                                                                                                                                                                                                                                                                                                                                                                                                (ncx - 1)] ==
                                                                                                                                                                                                                                                                                                                                                                                                            1 else 0), ncx] if ncc[ncx] == ncc[nci] else ncg_, ncg_, ncx), [1, nci], Range(nci + 1, nchi[nci], 1)),
                                                                                                                                                                                                                                                                                                                                                                      ) if ncc[nci] % 2 ==
                                                                                                                                                                                                                                                                                                                                                                          1 else Fold(Function(sum_nct +
                                                                                                                                                                                                                                                                                                                                                                                              (1 if nci + nct + 1 >
                                                                                                                                                                                                                                                                                                                                                                                                    ncj else ncf[(_n -
                                                                                                                                                                                                                                                                                                                                                                                                               (nci + nct + 1)) *
                                                                                                                                                                                                                                                                                                                                                                                                              _n +
                                                                                                                                                                                                                                                                                                                                                                                                              ncj] if ncl[(nci + nct + 1 -
                                                                                                                                                                                                                                                                                                                                                                                                                        1) *
                                                                                                                                                                                                                                                                                                                                                                                                                       _n +
                                                                                                                                                                                                                                                                                                                                                                                                                       ncj] ==
                                                                                                                                                                                                                                                                                                                                                                                                                   1 else 0) *
                                                                                                                                                                                                                                                                                                                                                                                              ncw[nct + 1], sum_nct, nct), 0, Range(0, ncj - nci, 1)),
                                                                                                                                                                                                                                                                                                                                                    ), ncj_l, ncj), Map(Function(0, ncj_z), Range(1, _n, 1)), Range(1, _n, 1)),
                                                                                                                                                                                                                                                                                                                           ),
                                                                                                                                                                                                                                                                                               [] if ncc[nci] % 2 ==
                                                                                                                                                                                                                                                                                                     1 else Fold(
                                                                                                                                                                                                                                                                                                                 Function(ReplaceAt(nct_l, nct - 0 +
                                                                                                                                                                                                                                                                                                                                           1, Fold(Function(sum_ncm +
                                                                                                                                                                                                                                                                                                                                                           ncd[nct *
                                                                                                                                                                                                                                                                                                                                                               (_n + 1) + ncm + 1] *
                                                                                                                                                                                                                                                                                                                                                           (ncm - 1)!, sum_ncm, ncm), 0, Range(1, Min(_n, nct + 1), 1))), nct_l, nct),
                                                                                                                                                                                                                                                                                                                 Map(Function(0, nct_z), Range(0, _n - nci, 1)),
                                                                                                                                                                                                                                                                                                                 Range(0, _n - nci, 1),
                                                                                                                                                                                                                                                                                                               ),
                                                                                                                                                                                                                                                                                             ),
                                                                                                                                                                                                                                                                [] if ncc[nci] % 2 ==
                                                                                                                                                                                                                                                                      1 else Fold(
                                                                                                                                                                                                                                                                                  Function(Join(
                                                                                                                                                                                                                                                                                                 nd_t,
                                                                                                                                                                                                                                                                                                 Fold(
                                                                                                                                                                                                                                                                                                       Function(ReplaceAt(
                                                                                                                                                                                                                                                                                                                           nd_row,
                                                                                                                                                                                                                                                                                                                           nd_c + 1,
                                                                                                                                                                                                                                                                                                                           0 if nd_c >
                                                                                                                                                                                                                                                                                                                                nd_s + 1 else Apply((ndv: integer) => Apply(
                                                                                                                                                                                                                                                                                                                                                                     (ndm: integer) => 0 if ncc[ndv] % 2 ==
                                                                                                                                                                                                                                                                                                                                                                                            1 ||
                                                                                                                                                                                                                                                                                                                                                                                            ndm < 0 else Fold(Function(sum_ndu +
                                                                                                                                                                                                                                                                                                                                                                                                                nd_t[ndu *
                                                                                                                                                                                                                                                                                                                                                                                                                     (_n + 1) + ndm + 1] *
                                                                                                                                                                                                                                                                                                                                                                                                                (1 if nci + ndu + 1 >
                                                                                                                                                                                                                                                                                                                                                                                                                      ndv - 1 else ncf[(_n -
                                                                                                                                                                                                                                                                                                                                                                                                                                 (nci + ndu + 1)) *
                                                                                                                                                                                                                                                                                                                                                                                                                                _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                (ndv - 1)] if ncl[(nci + ndu + 1 -
                                                                                                                                                                                                                                                                                                                                                                                                                                          1) *
                                                                                                                                                                                                                                                                                                                                                                                                                                         _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                         (ndv - 1)] ==
                                                                                                                                                                                                                                                                                                                                                                                                                                     1 else 0), sum_ndu, ndu), 0, Range(Max(0, ndm - 1), nd_s - 1, 1)),
                                                                                                                                                                                                                                                                                                                                                                     nd_c -
                                                                                                                                                                                                                                                                                                                                                                     (1 if nclo[ndv] == ndv else 0),
                                                                                                                                                                                                                                                                                                                                                                   ), nci + nd_s),
                                                                                                                                                                                                                                                                                                                         ), nd_row, nd_c),
                                                                                                                                                                                                                                                                                                       Map(Function(0, nd_z), Range(0, _n + 1 -
                                                                                                                                                                                                                                                                                                                                       1, 1)),
                                                                                                                                                                                                                                                                                                       Range(0, _n + 1 -
                                                                                                                                                                                                                                                                                                                1, 1),
                                                                                                                                                                                                                                                                                                     ),
                                                                                                                                                                                                                                                                                               ), nd_t, nd_s),
                                                                                                                                                                                                                                                                                  Fold(
                                                                                                                                                                                                                                                                                        Function(ReplaceAt(nd_row, nd_c + 1, 1 if nd_c == 1 &&
                                                                                                                                                                                                                                                                                                                                  !(ncc[nci] % 2 ==
                                                                                                                                                                                                                                                                                                                                    1) else 0), nd_row, nd_c),
                                                                                                                                                                                                                                                                                        Map(Function(0, nd_z), Range(0, _n + 1 -
                                                                                                                                                                                                                                                                                                                        1, 1)),
                                                                                                                                                                                                                                                                                        Range(0, _n + 1 -
                                                                                                                                                                                                                                                                                                 1, 1),
                                                                                                                                                                                                                                                                                      ),
                                                                                                                                                                                                                                                                                  Range(1, _n - nci +
                                                                                                                                                                                                                                                                                           1 -
                                                                                                                                                                                                                                                                                           1, 1),
                                                                                                                                                                                                                                                                                ),
                                                                                                                                                                                                                                                              ), _n - nck2), ncf, nck2), [], Range(0, _n - 1, 1)),
                                                                                                                                                                                                                 ),
                                                                                                                                                                                    Fold(
                                                                                                                                                                                          Function(ReplaceAt(nqi_l, nqi - 0 +
                                                                                                                                                                                                                    1, Apply((nqa: integer) => Apply(
                                                                                                                                                                                                                                                     (nqb: integer) => 1 if nqa > nqb else 1 if Fold(Function(nqok &&
                                                                                                                                                                                                                                                                                                              nclo[nqx] >= nqa &&
                                                                                                                                                                                                                                                                                                              nchi[nqx] <= nqb, nqok, nqx), True, Range(nqa, nqb, 1)) else 0,
                                                                                                                                                                                                                                                     nqi % _n +
                                                                                                                                                                                                                                                     1,
                                                                                                                                                                                                                                                   ), (nqi -
                                                                                                                                                                                                                                                      nqi % _n) /
                                                                                                                                                                                                                                                     _n +
                                                                                                                                                                                                                                                     1)), nqi_l, nqi),
                                                                                                                                                                                          Map(Function(0, nqi_z), Range(0, _n * _n -
                                                                                                                                                                                                                           1, 1)),
                                                                                                                                                                                          Range(0, _n * _n -
                                                                                                                                                                                                   1, 1),
                                                                                                                                                                                        ),
                                                                                                                                                                                  ),
                                                                                                                                                    Fold(
                                                                                                                                                          Function(ReplaceAt(nha_l, nha - 1 +
                                                                                                                                                                                    1, Fold(
                                                                                                                                                                                            Function(Max(nhe, nhb if ncc[nhb] == ncc[nha] else 0), nhe, nhb),
                                                                                                                                                                                            0,
                                                                                                                                                                                            Range(1, _n, 1),
                                                                                                                                                                                          )), nha_l, nha),
                                                                                                                                                          Map(Function(0, nha_z), Range(1, _n, 1)),
                                                                                                                                                          Range(1, _n, 1),
                                                                                                                                                        ),
                                                                                                                                                  ),
                                                                                                                    Fold(
                                                                                                                          Function(ReplaceAt(
                                                                                                                                              nla_l,
                                                                                                                                              nla - 1 +
                                                                                                                                              1,
                                                                                                                                              Fold(
                                                                                                                                                    Function(Min(nle, nlb if ncc[nlb] == ncc[nla] else _n + 1), nle, nlb),
                                                                                                                                                    _n + 1,
                                                                                                                                                    Range(1, _n, 1),
                                                                                                                                                  ),
                                                                                                                                            ), nla_l, nla),
                                                                                                                          Map(Function(0, nla_z), Range(1, _n, 1)),
                                                                                                                          Range(1, _n, 1),
                                                                                                                        ),
                                                                                                                  ),
                                                                                     Fold(
                                                                                           Function(ReplaceAt(
                                                                                                               nca_l,
                                                                                                               nca - 1 +
                                                                                                               1,
                                                                                                               Apply(
                                                                                                                      (ncw: list<integer>) => 2 * ncw[3] +
                                                                                                                                              1 if ncw[2] == 2 else 2 * ncw[1],
                                                                                                                      Fold(Function(
                                                                                                                                     ncs if ncs[2] != 0 else [ncs[1], 1, ncs[3]] if ncs[1] > filled else Apply((ncq: integer) => Apply((ncy: integer) => [ncs[1], 2, ncs[3]] if ncy == nca else [ncy, 0, Min(ncs[3], ncy)], prefix[ncq]), ncs[1]),
                                                                                                                                     ncs,
                                                                                                                                     nck,
                                                                                                                                   ), [nca, 0, nca], Range(1, _n, 1)),
                                                                                                                    ),
                                                                                                             ), nca_l, nca),
                                                                                           Map(
                                                                                                Function(0, nca_z),
                                                                                                Range(1, _n, 1),
                                                                                              ),
                                                                                           Range(1, _n, 1),
                                                                                         ),
                                                                                   ), 0), Map(
                                                                                              Function(0, lr_y),
                                                                                              Range(1, _n, 1),
                                                                                            ))

unrank(_n, _r)

Take(Fold(Function(Apply(
                          (lr_chosen: list<integer>) => ReplaceAt(
                                                                   ReplaceAt(
                                                                              ReplaceAt(lr_s, lr_j, lr_chosen[2]),
                                                                              _n +
                                                                              1,
                                                                              lr_chosen[1],
                                                                            ),
                                                                   _n + 1 +
                                                                   lr_chosen[2],
                                                                   lr_j,
                                                                 ),
                          Fold(Function(lr_pick if lr_pick[2] != 0 else lr_pick if lr_s[_n + 1 + lr_v] !=
                                                                                   0 else Apply(
                                                                                                (lr_c: integer) => [lr_pick[1], lr_v] if lr_pick[1] < lr_c else [lr_pick[1] - lr_c, 0],
                                                                                                Apply((prefix: list<integer>) => Apply((filled: integer) => 1 if _n == 0 else Apply(
                                                                                                                                                                                     (ncc: list<integer>) => Apply(
                                                                                                                                                                                                                    (nclo: list<integer>) => Apply(
                                                                                                                                                                                                                                                    (nchi: list<integer>) => Apply(
                                                                                                                                                                                                                                                                                    (ncl: list<integer>) => Apply(
                                                                                                                                                                                                                                                                                                                   (ncf: list<integer>) => 1 if 1 > _n else ncf[(_n - 1) *
                                                                                                                                                                                                                                                                                                                                                                _n +
                                                                                                                                                                                                                                                                                                                                                                _n] if ncl[(1 - 1) *
                                                                                                                                                                                                                                                                                                                                                                         _n +
                                                                                                                                                                                                                                                                                                                                                                         _n] ==
                                                                                                                                                                                                                                                                                                                                                                     1 else 0,
                                                                                                                                                                                                                                                                                                                   Fold(Function(Apply((nci: integer) => Apply(
                                                                                                                                                                                                                                                                                                                                                                (ncd: list<integer>) => Apply(
                                                                                                                                                                                                                                                                                                                                                                                               (ncw: list<integer>) => Join(ncf, Fold(Function(ReplaceAt(
                                                                                                                                                                                                                                                                                                                                                                                                                                                          ncj_l,
                                                                                                                                                                                                                                                                                                                                                                                                                                                          ncj - 1 +
                                                                                                                                                                                                                                                                                                                                                                                                                                                          1,
                                                                                                                                                                                                                                                                                                                                                                                                                                                          0 if ncj < nci ||
                                                                                                                                                                                                                                                                                                                                                                                                                                                               ncl[(nci - 1) *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ncj] ==
                                                                                                                                                                                                                                                                                                                                                                                                                                                               0 else Apply(
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            (ncg: list<integer>) => ncg[1] *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    (1 if nchi[nci] + 1 >
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ncj else ncf[(_n -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     (nchi[nci] + 1)) *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ncj] if ncl[(nchi[nci] + 1 -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              1) *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             ncj] ==
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         1 else 0),
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Fold(Function([ncg_[1] *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           (1 if ncg_[2] + 1 >
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ncx - 1 else ncf[(_n -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            (ncg_[2] + 1)) *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           (ncx - 1)] if ncl[(ncg_[2] + 1 -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     1) *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    (ncx - 1)] ==
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1 else 0), ncx] if ncc[ncx] == ncc[nci] else ncg_, ncg_, ncx), [1, nci], Range(nci + 1, nchi[nci], 1)),
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ) if ncc[nci] % 2 ==
                                                                                                                                                                                                                                                                                                                                                                                                                                                                              1 else Fold(Function(sum_nct +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  (1 if nci + nct + 1 >
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ncj else ncf[(_n -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   (nci + nct + 1)) *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ncj] if ncl[(nci + nct + 1 -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            1) *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ncj] ==
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       1 else 0) *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ncw[nct + 1], sum_nct, nct), 0, Range(0, ncj - nci, 1)),
                                                                                                                                                                                                                                                                                                                                                                                                                                                        ), ncj_l, ncj), Map(Function(0, ncj_z), Range(1, _n, 1)), Range(1, _n, 1))),
                                                                                                                                                                                                                                                                                                                                                                                               [] if ncc[nci] % 2 ==
                                                                                                                                                                                                                                                                                                                                                                                                     1 else Fold(
                                                                                                                                                                                                                                                                                                                                                                                                                 Function(ReplaceAt(nct_l, nct - 0 +
                                                                                                                                                                                                                                                                                                                                                                                                                                           1, Fold(Function(sum_ncm +
                                                                                                                                                                                                                                                                                                                                                                                                                                                           ncd[nct *
                                                                                                                                                                                                                                                                                                                                                                                                                                                               (_n + 1) + ncm + 1] *
                                                                                                                                                                                                                                                                                                                                                                                                                                                           (ncm - 1)!, sum_ncm, ncm), 0, Range(1, Min(_n, nct + 1), 1))), nct_l, nct),
                                                                                                                                                                                                                                                                                                                                                                                                                 Map(Function(0, nct_z), Range(0, _n - nci, 1)),
                                                                                                                                                                                                                                                                                                                                                                                                                 Range(0, _n - nci, 1),
                                                                                                                                                                                                                                                                                                                                                                                                               ),
                                                                                                                                                                                                                                                                                                                                                                                             ),
                                                                                                                                                                                                                                                                                                                                                                [] if ncc[nci] % 2 ==
                                                                                                                                                                                                                                                                                                                                                                      1 else Fold(
                                                                                                                                                                                                                                                                                                                                                                                  Function(Join(nd_t, Fold(
                                                                                                                                                                                                                                                                                                                                                                                                            Function(ReplaceAt(
                                                                                                                                                                                                                                                                                                                                                                                                                                nd_row,
                                                                                                                                                                                                                                                                                                                                                                                                                                nd_c + 1,
                                                                                                                                                                                                                                                                                                                                                                                                                                0 if nd_c >
                                                                                                                                                                                                                                                                                                                                                                                                                                     nd_s + 1 else Apply((ndv: integer) => Apply((ndm: integer) => 0 if ncc[ndv] % 2 ==
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1 ||
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ndm < 0 else Fold(Function(sum_ndu +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    nd_t[ndu *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         (_n + 1) + ndm + 1] *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    (1 if nci + ndu + 1 >
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ndv - 1 else ncf[(_n -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     (nci + ndu + 1)) *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    (ndv - 1)] if ncl[(nci + ndu + 1 -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              1) *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             (ndv - 1)] ==
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         1 else 0), sum_ndu, ndu), 0, Range(Max(0, ndm - 1), nd_s - 1, 1)), nd_c -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              (1 if nclo[ndv] == ndv else 0)), nci + nd_s),
                                                                                                                                                                                                                                                                                                                                                                                                                              ), nd_row, nd_c),
                                                                                                                                                                                                                                                                                                                                                                                                            Map(Function(0, nd_z), Range(0, _n + 1 -
                                                                                                                                                                                                                                                                                                                                                                                                                                            1, 1)),
                                                                                                                                                                                                                                                                                                                                                                                                            Range(0, _n + 1 -
                                                                                                                                                                                                                                                                                                                                                                                                                     1, 1),
                                                                                                                                                                                                                                                                                                                                                                                                          )), nd_t, nd_s),
                                                                                                                                                                                                                                                                                                                                                                                  Fold(
                                                                                                                                                                                                                                                                                                                                                                                        Function(ReplaceAt(nd_row, nd_c + 1, 1 if nd_c == 1 &&
                                                                                                                                                                                                                                                                                                                                                                                                                                  !(ncc[nci] % 2 ==
                                                                                                                                                                                                                                                                                                                                                                                                                                    1) else 0), nd_row, nd_c),
                                                                                                                                                                                                                                                                                                                                                                                        Map(Function(0, nd_z), Range(0, _n + 1 -
                                                                                                                                                                                                                                                                                                                                                                                                                        1, 1)),
                                                                                                                                                                                                                                                                                                                                                                                        Range(0, _n + 1 -
                                                                                                                                                                                                                                                                                                                                                                                                 1, 1),
                                                                                                                                                                                                                                                                                                                                                                                      ),
                                                                                                                                                                                                                                                                                                                                                                                  Range(1, _n - nci +
                                                                                                                                                                                                                                                                                                                                                                                           1 -
                                                                                                                                                                                                                                                                                                                                                                                           1, 1),
                                                                                                                                                                                                                                                                                                                                                                                ),
                                                                                                                                                                                                                                                                                                                                                              ), _n - nck2), ncf, nck2), [], Range(0, _n - 1, 1)),
                                                                                                                                                                                                                                                                                                                 ),
                                                                                                                                                                                                                                                                                    Fold(
                                                                                                                                                                                                                                                                                          Function(ReplaceAt(nqi_l, nqi - 0 +
                                                                                                                                                                                                                                                                                                                    1, Apply(
                                                                                                                                                                                                                                                                                                                             (nqa: integer) => Apply((nqb: integer) => 1 if nqa > nqb else 1 if Fold(Function(nqok &&
                                                                                                                                                                                                                                                                                                                                                                                                              nclo[nqx] >= nqa &&
                                                                                                                                                                                                                                                                                                                                                                                                              nchi[nqx] <= nqb, nqok, nqx), True, Range(nqa, nqb, 1)) else 0, nqi % _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              1),
                                                                                                                                                                                                                                                                                                                             (nqi -
                                                                                                                                                                                                                                                                                                                              nqi % _n) /
                                                                                                                                                                                                                                                                                                                             _n +
                                                                                                                                                                                                                                                                                                                             1,
                                                                                                                                                                                                                                                                                                                           )), nqi_l, nqi),
                                                                                                                                                                                                                                                                                          Map(Function(0, nqi_z), Range(0, _n * _n -
                                                                                                                                                                                                                                                                                                                           1, 1)),
                                                                                                                                                                                                                                                                                          Range(0, _n * _n -
                                                                                                                                                                                                                                                                                                   1, 1),
                                                                                                                                                                                                                                                                                        ),
                                                                                                                                                                                                                                                                                  ),
                                                                                                                                                                                                                                                    Fold(
                                                                                                                                                                                                                                                          Function(ReplaceAt(nha_l, nha - 1 +
                                                                                                                                                                                                                                                                                    1, Fold(Function(Max(nhe, nhb if ncc[nhb] == ncc[nha] else 0), nhe, nhb), 0, Range(1, _n, 1))), nha_l, nha),
                                                                                                                                                                                                                                                          Map(Function(0, nha_z), Range(1, _n, 1)),
                                                                                                                                                                                                                                                          Range(1, _n, 1),
                                                                                                                                                                                                                                                        ),
                                                                                                                                                                                                                                                  ),
                                                                                                                                                                                                                    Fold(
                                                                                                                                                                                                                          Function(ReplaceAt(nla_l, nla - 1 +
                                                                                                                                                                                                                                                    1, Fold(
                                                                                                                                                                                                                                                            Function(Min(nle, nlb if ncc[nlb] == ncc[nla] else _n + 1), nle, nlb),
                                                                                                                                                                                                                                                            _n + 1,
                                                                                                                                                                                                                                                            Range(1, _n, 1),
                                                                                                                                                                                                                                                          )), nla_l, nla),
                                                                                                                                                                                                                          Map(Function(0, nla_z), Range(1, _n, 1)),
                                                                                                                                                                                                                          Range(1, _n, 1),
                                                                                                                                                                                                                        ),
                                                                                                                                                                                                                  ),
                                                                                                                                                                                     Fold(
                                                                                                                                                                                           Function(ReplaceAt(
                                                                                                                                                                                                               nca_l,
                                                                                                                                                                                                               nca - 1 +
                                                                                                                                                                                                               1,
                                                                                                                                                                                                               Apply(
                                                                                                                                                                                                                      (ncw: list<integer>) => 2 * ncw[3] +
                                                                                                                                                                                                                                              1 if ncw[2] == 2 else 2 * ncw[1],
                                                                                                                                                                                                                      Fold(
                                                                                                                                                                                                                            Function(ncs if ncs[2] != 0 else [ncs[1], 1, ncs[3]] if ncs[1] > filled else Apply((ncq: integer) => Apply((ncy: integer) => [ncs[1], 2, ncs[3]] if ncy == nca else [ncy, 0, Min(ncs[3], ncy)], prefix[ncq]), ncs[1]), ncs, nck),
                                                                                                                                                                                                                            [nca, 0, nca],
                                                                                                                                                                                                                            Range(1, _n, 1),
                                                                                                                                                                                                                          ),
                                                                                                                                                                                                                    ),
                                                                                                                                                                                                             ), nca_l, nca),
                                                                                                                                                                                           Map(Function(0, nca_z), Range(1, _n, 1)),
                                                                                                                                                                                           Range(1, _n, 1),
                                                                                                                                                                                         ),
                                                                                                                                                                                   ), lr_j), ReplaceAt(lr_s, lr_j, lr_v)),
                                                                                              ), lr_pick, lr_v), [lr_s[_n + 1], 0], Range(1, _n, 1)),
                        ), lr_s, lr_j), Join(Map(
                                                 Function(0, lr_y),
                                                 Range(1, _n, 1),
                                               ), [_r], Map(
                                                            Function(0, lr_y2),
                                                            Range(1, _n, 1),
                                                          )), Range(1, _n, 1)), _n)

rank(_n, _x)

Apply(
       (lr_where: list<integer>) => Fold(Function(lr_r + Apply(
                                                                (lr_base: list<integer>) => Fold(Function(lr_r2 +
                                                                                                          (Apply((prefix: list<integer>) => Apply((filled: integer) => 1 if _n == 0 else Apply(
                                                                                                                                                                                                (ncc: list<integer>) => Apply(
                                                                                                                                                                                                                               (nclo: list<integer>) => Apply(
                                                                                                                                                                                                                                                               (nchi: list<integer>) => Apply(
                                                                                                                                                                                                                                                                                               (ncl: list<integer>) => Apply(
                                                                                                                                                                                                                                                                                                                              (ncf: list<integer>) => 1 if 1 > _n else ncf[(_n - 1) *
                                                                                                                                                                                                                                                                                                                                                                           _n +
                                                                                                                                                                                                                                                                                                                                                                           _n] if ncl[(1 - 1) *
                                                                                                                                                                                                                                                                                                                                                                                    _n +
                                                                                                                                                                                                                                                                                                                                                                                    _n] ==
                                                                                                                                                                                                                                                                                                                                                                                1 else 0,
                                                                                                                                                                                                                                                                                                                              Fold(Function(Apply((nci: integer) => Apply(
                                                                                                                                                                                                                                                                                                                                                                           (ncd: list<integer>) => Apply(
                                                                                                                                                                                                                                                                                                                                                                                                          (ncw: list<integer>) => Join(ncf, Fold(Function(ReplaceAt(
                                                                                                                                                                                                                                                                                                                                                                                                                                                                     ncj_l,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                     ncj - 1 +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                     1,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                     0 if ncj < nci ||
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ncl[(nci - 1) *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                              _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ncj] ==
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          0 else Apply(
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       (ncg: list<integer>) => ncg[1] *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               (1 if nchi[nci] + 1 >
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     ncj else ncf[(_n -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                (nchi[nci] + 1)) *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ncj] if ncl[(nchi[nci] + 1 -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         1) *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ncj] ==
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    1 else 0),
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       Fold(Function([ncg_[1] *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      (1 if ncg_[2] + 1 >
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ncx - 1 else ncf[(_n -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       (ncg_[2] + 1)) *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      (ncx - 1)] if ncl[(ncg_[2] + 1 -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1) *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               (ncx - 1)] ==
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           1 else 0), ncx] if ncc[ncx] == ncc[nci] else ncg_, ncg_, ncx), [1, nci], Range(nci + 1, nchi[nci], 1)),
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     ) if ncc[nci] % 2 ==
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         1 else Fold(Function(sum_nct +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             (1 if nci + nct + 1 >
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ncj else ncf[(_n -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              (nci + nct + 1)) *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             ncj] if ncl[(nci + nct + 1 -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       1) *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ncj] ==
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1 else 0) *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             ncw[nct + 1], sum_nct, nct), 0, Range(0, ncj - nci, 1)),
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ), ncj_l, ncj), Map(Function(0, ncj_z), Range(1, _n, 1)), Range(1, _n, 1))),
                                                                                                                                                                                                                                                                                                                                                                                                          [] if ncc[nci] % 2 ==
                                                                                                                                                                                                                                                                                                                                                                                                                1 else Fold(
                                                                                                                                                                                                                                                                                                                                                                                                                            Function(ReplaceAt(nct_l, nct - 0 +
                                                                                                                                                                                                                                                                                                                                                                                                                                                      1, Fold(Function(sum_ncm +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ncd[nct *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          (_n + 1) + ncm + 1] *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                      (ncm - 1)!, sum_ncm, ncm), 0, Range(1, Min(_n, nct + 1), 1))), nct_l, nct),
                                                                                                                                                                                                                                                                                                                                                                                                                            Map(Function(0, nct_z), Range(0, _n - nci, 1)),
                                                                                                                                                                                                                                                                                                                                                                                                                            Range(0, _n - nci, 1),
                                                                                                                                                                                                                                                                                                                                                                                                                          ),
                                                                                                                                                                                                                                                                                                                                                                                                        ),
                                                                                                                                                                                                                                                                                                                                                                           [] if ncc[nci] % 2 ==
                                                                                                                                                                                                                                                                                                                                                                                 1 else Fold(
                                                                                                                                                                                                                                                                                                                                                                                             Function(Join(nd_t, Fold(
                                                                                                                                                                                                                                                                                                                                                                                                                       Function(ReplaceAt(
                                                                                                                                                                                                                                                                                                                                                                                                                                           nd_row,
                                                                                                                                                                                                                                                                                                                                                                                                                                           nd_c + 1,
                                                                                                                                                                                                                                                                                                                                                                                                                                           0 if nd_c >
                                                                                                                                                                                                                                                                                                                                                                                                                                                nd_s + 1 else Apply((ndv: integer) => Apply((ndm: integer) => 0 if ncc[ndv] % 2 ==
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           1 ||
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ndm < 0 else Fold(Function(sum_ndu +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               nd_t[ndu *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    (_n + 1) + ndm + 1] *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               (1 if nci + ndu + 1 >
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     ndv - 1 else ncf[(_n -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                (nci + ndu + 1)) *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               (ndv - 1)] if ncl[(nci + ndu + 1 -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         1) *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        (ndv - 1)] ==
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    1 else 0), sum_ndu, ndu), 0, Range(Max(0, ndm - 1), nd_s - 1, 1)), nd_c -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         (1 if nclo[ndv] == ndv else 0)), nci + nd_s),
                                                                                                                                                                                                                                                                                                                                                                                                                                         ), nd_row, nd_c),
                                                                                                                                                                                                                                                                                                                                                                                                                       Map(Function(0, nd_z), Range(0, _n + 1 -
                                                                                                                                                                                                                                                                                                                                                                                                                                                       1, 1)),
                                                                                                                                                                                                                                                                                                                                                                                                                       Range(0, _n + 1 -
                                                                                                                                                                                                                                                                                                                                                                                                                                1, 1),
                                                                                                                                                                                                                                                                                                                                                                                                                     )), nd_t, nd_s),
                                                                                                                                                                                                                                                                                                                                                                                             Fold(
                                                                                                                                                                                                                                                                                                                                                                                                   Function(ReplaceAt(nd_row, nd_c + 1, 1 if nd_c == 1 &&
                                                                                                                                                                                                                                                                                                                                                                                                                                             !(ncc[nci] % 2 ==
                                                                                                                                                                                                                                                                                                                                                                                                                                               1) else 0), nd_row, nd_c),
                                                                                                                                                                                                                                                                                                                                                                                                   Map(Function(0, nd_z), Range(0, _n + 1 -
                                                                                                                                                                                                                                                                                                                                                                                                                                   1, 1)),
                                                                                                                                                                                                                                                                                                                                                                                                   Range(0, _n + 1 -
                                                                                                                                                                                                                                                                                                                                                                                                            1, 1),
                                                                                                                                                                                                                                                                                                                                                                                                 ),
                                                                                                                                                                                                                                                                                                                                                                                             Range(1, _n - nci +
                                                                                                                                                                                                                                                                                                                                                                                                      1 -
                                                                                                                                                                                                                                                                                                                                                                                                      1, 1),
                                                                                                                                                                                                                                                                                                                                                                                           ),
                                                                                                                                                                                                                                                                                                                                                                         ), _n - nck2), ncf, nck2), [], Range(0, _n - 1, 1)),
                                                                                                                                                                                                                                                                                                                            ),
                                                                                                                                                                                                                                                                                               Fold(
                                                                                                                                                                                                                                                                                                     Function(ReplaceAt(nqi_l, nqi - 0 +
                                                                                                                                                                                                                                                                                                                               1, Apply(
                                                                                                                                                                                                                                                                                                                                        (nqa: integer) => Apply((nqb: integer) => 1 if nqa > nqb else 1 if Fold(Function(nqok &&
                                                                                                                                                                                                                                                                                                                                                                                                                         nclo[nqx] >= nqa &&
                                                                                                                                                                                                                                                                                                                                                                                                                         nchi[nqx] <= nqb, nqok, nqx), True, Range(nqa, nqb, 1)) else 0, nqi % _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                         1),
                                                                                                                                                                                                                                                                                                                                        (nqi -
                                                                                                                                                                                                                                                                                                                                         nqi % _n) /
                                                                                                                                                                                                                                                                                                                                        _n +
                                                                                                                                                                                                                                                                                                                                        1,
                                                                                                                                                                                                                                                                                                                                      )), nqi_l, nqi),
                                                                                                                                                                                                                                                                                                     Map(Function(0, nqi_z), Range(0, _n * _n -
                                                                                                                                                                                                                                                                                                                                      1, 1)),
                                                                                                                                                                                                                                                                                                     Range(0, _n * _n -
                                                                                                                                                                                                                                                                                                              1, 1),
                                                                                                                                                                                                                                                                                                   ),
                                                                                                                                                                                                                                                                                             ),
                                                                                                                                                                                                                                                               Fold(
                                                                                                                                                                                                                                                                     Function(ReplaceAt(nha_l, nha - 1 +
                                                                                                                                                                                                                                                                                               1, Fold(Function(Max(nhe, nhb if ncc[nhb] == ncc[nha] else 0), nhe, nhb), 0, Range(1, _n, 1))), nha_l, nha),
                                                                                                                                                                                                                                                                     Map(Function(0, nha_z), Range(1, _n, 1)),
                                                                                                                                                                                                                                                                     Range(1, _n, 1),
                                                                                                                                                                                                                                                                   ),
                                                                                                                                                                                                                                                             ),
                                                                                                                                                                                                                               Fold(
                                                                                                                                                                                                                                     Function(ReplaceAt(nla_l, nla - 1 +
                                                                                                                                                                                                                                                               1, Fold(Function(Min(nle, nlb if ncc[nlb] == ncc[nla] else _n + 1), nle, nlb), _n + 1, Range(1, _n, 1))), nla_l, nla),
                                                                                                                                                                                                                                     Map(Function(0, nla_z), Range(1, _n, 1)),
                                                                                                                                                                                                                                     Range(1, _n, 1),
                                                                                                                                                                                                                                   ),
                                                                                                                                                                                                                             ),
                                                                                                                                                                                                Fold(
                                                                                                                                                                                                      Function(ReplaceAt(
                                                                                                                                                                                                                          nca_l,
                                                                                                                                                                                                                          nca - 1 +
                                                                                                                                                                                                                          1,
                                                                                                                                                                                                                          Apply(
                                                                                                                                                                                                                                 (ncw: list<integer>) => 2 * ncw[3] +
                                                                                                                                                                                                                                                         1 if ncw[2] == 2 else 2 * ncw[1],
                                                                                                                                                                                                                                 Fold(
                                                                                                                                                                                                                                       Function(ncs if ncs[2] != 0 else [ncs[1], 1, ncs[3]] if ncs[1] > filled else Apply((ncq: integer) => Apply((ncy: integer) => [ncs[1], 2, ncs[3]] if ncy == nca else [ncy, 0, Min(ncs[3], ncy)], prefix[ncq]), ncs[1]), ncs, nck),
                                                                                                                                                                                                                                       [nca, 0, nca],
                                                                                                                                                                                                                                       Range(1, _n, 1),
                                                                                                                                                                                                                                     ),
                                                                                                                                                                                                                               ),
                                                                                                                                                                                                                        ), nca_l, nca),
                                                                                                                                                                                                      Map(Function(0, nca_z), Range(1, _n, 1)),
                                                                                                                                                                                                      Range(1, _n, 1),
                                                                                                                                                                                                    ),
                                                                                                                                                                                              ), lr_j), ReplaceAt(lr_base, lr_j, lr_v)) if lr_where[lr_v] > lr_j else 0), lr_r2, lr_v), 0, Range(1, _x[lr_j] - 1, 1)),
                                                                Map(
                                                                     Function(
                                                                               _x[lr_q] if lr_q < lr_j else 0,
                                                                               lr_q,
                                                                             ),
                                                                     Range(
                                                                            1,
                                                                            _n,
                                                                            1,
                                                                          ),
                                                                   ),
                                                              ), lr_r, lr_j), 0, Range(1, _n, 1)),
       Fold(
             Function(ReplaceAt(lr_at, _x[lr_p], lr_p), lr_at, lr_p),
             Map(Function(0, lr_y3), Range(1, _n, 1)),
             Range(1, _n, 1),
           ),
     )

valid(_n, _x)

(Apply((prefix: list<integer>) => Apply((filled: integer) => 1 if _n == 0 else Apply(
                                                                                      (ncc: list<integer>) => Apply(
                                                                                                                     (nclo: list<integer>) => Apply(
                                                                                                                                                     (nchi: list<integer>) => Apply(
                                                                                                                                                                                     (ncl: list<integer>) => Apply(
                                                                                                                                                                                                                    (ncf: list<integer>) => 1 if 1 > _n else ncf[(_n - 1) *
                                                                                                                                                                                                                                                                 _n +
                                                                                                                                                                                                                                                                 _n] if ncl[(1 - 1) *
                                                                                                                                                                                                                                                                          _n +
                                                                                                                                                                                                                                                                          _n] ==
                                                                                                                                                                                                                                                                      1 else 0,
                                                                                                                                                                                                                    Fold(Function(Apply((nci: integer) => Apply(
                                                                                                                                                                                                                                                                 (ncd: list<integer>) => Apply(
                                                                                                                                                                                                                                                                                                (ncw: list<integer>) => Join(
                                                                                                                                                                                                                                                                                                                              ncf,
                                                                                                                                                                                                                                                                                                                              Fold(Function(ReplaceAt(
                                                                                                                                                                                                                                                                                                                                                       ncj_l,
                                                                                                                                                                                                                                                                                                                                                       ncj - 1 +
                                                                                                                                                                                                                                                                                                                                                       1,
                                                                                                                                                                                                                                                                                                                                                       0 if ncj < nci ||
                                                                                                                                                                                                                                                                                                                                                            ncl[(nci - 1) *
                                                                                                                                                                                                                                                                                                                                                                _n +
                                                                                                                                                                                                                                                                                                                                                                ncj] ==
                                                                                                                                                                                                                                                                                                                                                            0 else Apply(
                                                                                                                                                                                                                                                                                                                                                                         (ncg: list<integer>) => ncg[1] *
                                                                                                                                                                                                                                                                                                                                                                                                 (1 if nchi[nci] + 1 >
                                                                                                                                                                                                                                                                                                                                                                                                       ncj else ncf[(_n -
                                                                                                                                                                                                                                                                                                                                                                                                                  (nchi[nci] + 1)) *
                                                                                                                                                                                                                                                                                                                                                                                                                 _n +
                                                                                                                                                                                                                                                                                                                                                                                                                 ncj] if ncl[(nchi[nci] + 1 -
                                                                                                                                                                                                                                                                                                                                                                                                                           1) *
                                                                                                                                                                                                                                                                                                                                                                                                                          _n +
                                                                                                                                                                                                                                                                                                                                                                                                                          ncj] ==
                                                                                                                                                                                                                                                                                                                                                                                                                      1 else 0),
                                                                                                                                                                                                                                                                                                                                                                         Fold(Function([ncg_[1] *
                                                                                                                                                                                                                                                                                                                                                                                        (1 if ncg_[2] + 1 >
                                                                                                                                                                                                                                                                                                                                                                                              ncx - 1 else ncf[(_n -
                                                                                                                                                                                                                                                                                                                                                                                                         (ncg_[2] + 1)) *
                                                                                                                                                                                                                                                                                                                                                                                                        _n +
                                                                                                                                                                                                                                                                                                                                                                                                        (ncx - 1)] if ncl[(ncg_[2] + 1 -
                                                                                                                                                                                                                                                                                                                                                                                                                  1) *
                                                                                                                                                                                                                                                                                                                                                                                                                 _n +
                                                                                                                                                                                                                                                                                                                                                                                                                 (ncx - 1)] ==
                                                                                                                                                                                                                                                                                                                                                                                                             1 else 0), ncx] if ncc[ncx] == ncc[nci] else ncg_, ncg_, ncx), [1, nci], Range(nci + 1, nchi[nci], 1)),
                                                                                                                                                                                                                                                                                                                                                                       ) if ncc[nci] % 2 ==
                                                                                                                                                                                                                                                                                                                                                                           1 else Fold(Function(sum_nct +
                                                                                                                                                                                                                                                                                                                                                                                               (1 if nci + nct + 1 >
                                                                                                                                                                                                                                                                                                                                                                                                     ncj else ncf[(_n -
                                                                                                                                                                                                                                                                                                                                                                                                                (nci + nct + 1)) *
                                                                                                                                                                                                                                                                                                                                                                                                               _n +
                                                                                                                                                                                                                                                                                                                                                                                                               ncj] if ncl[(nci + nct + 1 -
                                                                                                                                                                                                                                                                                                                                                                                                                         1) *
                                                                                                                                                                                                                                                                                                                                                                                                                        _n +
                                                                                                                                                                                                                                                                                                                                                                                                                        ncj] ==
                                                                                                                                                                                                                                                                                                                                                                                                                    1 else 0) *
                                                                                                                                                                                                                                                                                                                                                                                               ncw[nct + 1], sum_nct, nct), 0, Range(0, ncj - nci, 1)),
                                                                                                                                                                                                                                                                                                                                                     ), ncj_l, ncj), Map(Function(0, ncj_z), Range(1, _n, 1)), Range(1, _n, 1)),
                                                                                                                                                                                                                                                                                                                            ),
                                                                                                                                                                                                                                                                                                [] if ncc[nci] % 2 ==
                                                                                                                                                                                                                                                                                                      1 else Fold(
                                                                                                                                                                                                                                                                                                                  Function(ReplaceAt(nct_l, nct - 0 +
                                                                                                                                                                                                                                                                                                                                            1, Fold(Function(sum_ncm +
                                                                                                                                                                                                                                                                                                                                                            ncd[nct *
                                                                                                                                                                                                                                                                                                                                                                (_n + 1) + ncm + 1] *
                                                                                                                                                                                                                                                                                                                                                            (ncm - 1)!, sum_ncm, ncm), 0, Range(1, Min(_n, nct + 1), 1))), nct_l, nct),
                                                                                                                                                                                                                                                                                                                  Map(Function(0, nct_z), Range(0, _n - nci, 1)),
                                                                                                                                                                                                                                                                                                                  Range(0, _n - nci, 1),
                                                                                                                                                                                                                                                                                                                ),
                                                                                                                                                                                                                                                                                              ),
                                                                                                                                                                                                                                                                 [] if ncc[nci] % 2 ==
                                                                                                                                                                                                                                                                       1 else Fold(
                                                                                                                                                                                                                                                                                   Function(Join(
                                                                                                                                                                                                                                                                                                  nd_t,
                                                                                                                                                                                                                                                                                                  Fold(
                                                                                                                                                                                                                                                                                                        Function(ReplaceAt(
                                                                                                                                                                                                                                                                                                                            nd_row,
                                                                                                                                                                                                                                                                                                                            nd_c + 1,
                                                                                                                                                                                                                                                                                                                            0 if nd_c >
                                                                                                                                                                                                                                                                                                                                 nd_s + 1 else Apply((ndv: integer) => Apply(
                                                                                                                                                                                                                                                                                                                                                                      (ndm: integer) => 0 if ncc[ndv] % 2 ==
                                                                                                                                                                                                                                                                                                                                                                                             1 ||
                                                                                                                                                                                                                                                                                                                                                                                             ndm < 0 else Fold(Function(sum_ndu +
                                                                                                                                                                                                                                                                                                                                                                                                                 nd_t[ndu *
                                                                                                                                                                                                                                                                                                                                                                                                                      (_n + 1) + ndm + 1] *
                                                                                                                                                                                                                                                                                                                                                                                                                 (1 if nci + ndu + 1 >
                                                                                                                                                                                                                                                                                                                                                                                                                       ndv - 1 else ncf[(_n -
                                                                                                                                                                                                                                                                                                                                                                                                                                  (nci + ndu + 1)) *
                                                                                                                                                                                                                                                                                                                                                                                                                                 _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                 (ndv - 1)] if ncl[(nci + ndu + 1 -
                                                                                                                                                                                                                                                                                                                                                                                                                                           1) *
                                                                                                                                                                                                                                                                                                                                                                                                                                          _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                          (ndv - 1)] ==
                                                                                                                                                                                                                                                                                                                                                                                                                                      1 else 0), sum_ndu, ndu), 0, Range(Max(0, ndm - 1), nd_s - 1, 1)),
                                                                                                                                                                                                                                                                                                                                                                      nd_c -
                                                                                                                                                                                                                                                                                                                                                                      (1 if nclo[ndv] == ndv else 0),
                                                                                                                                                                                                                                                                                                                                                                    ), nci + nd_s),
                                                                                                                                                                                                                                                                                                                          ), nd_row, nd_c),
                                                                                                                                                                                                                                                                                                        Map(Function(0, nd_z), Range(0, _n + 1 -
                                                                                                                                                                                                                                                                                                                                        1, 1)),
                                                                                                                                                                                                                                                                                                        Range(0, _n + 1 -
                                                                                                                                                                                                                                                                                                                 1, 1),
                                                                                                                                                                                                                                                                                                      ),
                                                                                                                                                                                                                                                                                                ), nd_t, nd_s),
                                                                                                                                                                                                                                                                                   Fold(
                                                                                                                                                                                                                                                                                         Function(ReplaceAt(nd_row, nd_c + 1, 1 if nd_c == 1 &&
                                                                                                                                                                                                                                                                                                                                   !(ncc[nci] % 2 ==
                                                                                                                                                                                                                                                                                                                                     1) else 0), nd_row, nd_c),
                                                                                                                                                                                                                                                                                         Map(Function(0, nd_z), Range(0, _n + 1 -
                                                                                                                                                                                                                                                                                                                         1, 1)),
                                                                                                                                                                                                                                                                                         Range(0, _n + 1 -
                                                                                                                                                                                                                                                                                                  1, 1),
                                                                                                                                                                                                                                                                                       ),
                                                                                                                                                                                                                                                                                   Range(1, _n - nci +
                                                                                                                                                                                                                                                                                            1 -
                                                                                                                                                                                                                                                                                            1, 1),
                                                                                                                                                                                                                                                                                 ),
                                                                                                                                                                                                                                                               ), _n - nck2), ncf, nck2), [], Range(0, _n - 1, 1)),
                                                                                                                                                                                                                  ),
                                                                                                                                                                                     Fold(
                                                                                                                                                                                           Function(ReplaceAt(nqi_l, nqi - 0 +
                                                                                                                                                                                                                     1, Apply((nqa: integer) => Apply(
                                                                                                                                                                                                                                                      (nqb: integer) => 1 if nqa > nqb else 1 if Fold(Function(nqok &&
                                                                                                                                                                                                                                                                                                               nclo[nqx] >= nqa &&
                                                                                                                                                                                                                                                                                                               nchi[nqx] <= nqb, nqok, nqx), True, Range(nqa, nqb, 1)) else 0,
                                                                                                                                                                                                                                                      nqi % _n +
                                                                                                                                                                                                                                                      1,
                                                                                                                                                                                                                                                    ), (nqi -
                                                                                                                                                                                                                                                       nqi % _n) /
                                                                                                                                                                                                                                                      _n +
                                                                                                                                                                                                                                                      1)), nqi_l, nqi),
                                                                                                                                                                                           Map(Function(0, nqi_z), Range(0, _n * _n -
                                                                                                                                                                                                                            1, 1)),
                                                                                                                                                                                           Range(0, _n * _n -
                                                                                                                                                                                                    1, 1),
                                                                                                                                                                                         ),
                                                                                                                                                                                   ),
                                                                                                                                                     Fold(
                                                                                                                                                           Function(ReplaceAt(nha_l, nha - 1 +
                                                                                                                                                                                     1, Fold(
                                                                                                                                                                                             Function(Max(nhe, nhb if ncc[nhb] == ncc[nha] else 0), nhe, nhb),
                                                                                                                                                                                             0,
                                                                                                                                                                                             Range(1, _n, 1),
                                                                                                                                                                                           )), nha_l, nha),
                                                                                                                                                           Map(Function(0, nha_z), Range(1, _n, 1)),
                                                                                                                                                           Range(1, _n, 1),
                                                                                                                                                         ),
                                                                                                                                                   ),
                                                                                                                     Fold(
                                                                                                                           Function(ReplaceAt(
                                                                                                                                               nla_l,
                                                                                                                                               nla - 1 +
                                                                                                                                               1,
                                                                                                                                               Fold(
                                                                                                                                                     Function(Min(nle, nlb if ncc[nlb] == ncc[nla] else _n + 1), nle, nlb),
                                                                                                                                                     _n + 1,
                                                                                                                                                     Range(1, _n, 1),
                                                                                                                                                   ),
                                                                                                                                             ), nla_l, nla),
                                                                                                                           Map(Function(0, nla_z), Range(1, _n, 1)),
                                                                                                                           Range(1, _n, 1),
                                                                                                                         ),
                                                                                                                   ),
                                                                                      Fold(
                                                                                            Function(ReplaceAt(
                                                                                                                nca_l,
                                                                                                                nca - 1 +
                                                                                                                1,
                                                                                                                Apply(
                                                                                                                       (ncw: list<integer>) => 2 * ncw[3] +
                                                                                                                                               1 if ncw[2] == 2 else 2 * ncw[1],
                                                                                                                       Fold(Function(
                                                                                                                                      ncs if ncs[2] != 0 else [ncs[1], 1, ncs[3]] if ncs[1] > filled else Apply((ncq: integer) => Apply((ncy: integer) => [ncs[1], 2, ncs[3]] if ncy == nca else [ncy, 0, Min(ncs[3], ncy)], prefix[ncq]), ncs[1]),
                                                                                                                                      ncs,
                                                                                                                                      nck,
                                                                                                                                    ), [nca, 0, nca], Range(1, _n, 1)),
                                                                                                                     ),
                                                                                                              ), nca_l, nca),
                                                                                            Map(
                                                                                                 Function(0, nca_z),
                                                                                                 Range(1, _n, 1),
                                                                                               ),
                                                                                            Range(1, _n, 1),
                                                                                          ),
                                                                                    ), _n), _x) ==
 1 if Fold(Function(
                    (ReplaceAt(lr_d_seen, _x[lr_d_j], 1) if lr_d_seen[_x[lr_d_j]] ==
                                                            0 else ReplaceAt(
                                                                             lr_d_seen,
                                                                             _n +
                                                                             1,
                                                                             1,
                                                                           )) if 1 <= _x[lr_d_j] &&
                                                                                _x[lr_d_j] <= _n else ReplaceAt(lr_d_seen, _n + 1, 1),
                    lr_d_seen,
                    lr_d_j,
                  ), Map(Function(0, lr_d_z), Range(1, _n + 1, 1)), Range(
                                                                          1,
                                                                          _n,
                                                                          1,
                                                                        ))[_n + 1] ==
     0 else False) if Length(_x) == _n else False

Statistics

On Permutation, called as CombinatorialStat(x, "Name").

Maps

Into and out of Permutation, called as CombinatorialMap(x, "Name"). Properties are the laws we state and what FindStat records.

From Permutation

  • BinarySearchTreePermutation → BinaryTreesurjectionSurjectionGraded mapMp00072The tree built by inserting σ(1), σ(2), ... into an empty binary search tree.
  • BinarySearchTreeParentArrayPermutation → BinaryTreeParentArrayThe binary search tree of σ as its parent array: entry v is the value v is inserted under, 0 for the root.
  • CactusEvacuationPermutation → PermutationinvolutionBijectionGraded mapInvolutionMp00126The permutation with the same insertion tableau and the evacuation of the recording tableau.
  • ComplementPermutation → PermutationinvolutionBijectionGraded mapInvolutionMp00069Each entry replaced by n + 1 minus itself.
  • ConjugacyClassRepresentativePermutation → PermutationidempotentThe canonical permutation with the same cycle type.
  • ConjugateAfterCycleTypePermutation → IntegerPartitionThe conjugate partition of the cycle type.
  • ConnectivityWordPermutation → BinaryWordsurjectionSurjectionGraded mapMp00114Letter i is 1 when the first i entries are all smaller than the rest: the connectivity set as a binary word.
  • CycleAsOneLineNotationPermutation → PermutationGraded mapMp00090The cycles, each written from its least point and in order of those points, read as one word.
  • CycleDecompositionPermutation → CycleDecompositioninverseA permutation in cycle notation, fixed points kept: each cycle from its least point, cycles in order of those points.
  • CyclePartitionPermutation → SetPartitionsurjectionSurjectionGraded mapMp00151The orbits, as a set partition of the positions.
  • CycleTypePermutation → IntegerPartitionsurjectionSurjectionGraded mapMp00108The multiset of cycle lengths, as a partition.
  • CyclicShiftPermutation → PermutationinverseBijectionGraded mapMp00279Rotate the word one place to the left.
  • DescentBottomWordPermutation → BinaryWordsurjectionSurjectionGraded mapMp00131Letter v is 1 when value v is a descent bottom: some larger value immediately precedes it.
  • DescentCompositionPermutation → IntegerCompositionsurjectionSurjectionGraded mapMp00071The composition of n cut at the descent positions.
  • DescentSetPermutation → FinsetThe positions where the word falls.
  • DescentTopWordPermutation → BinaryWordsurjectionSurjectionGraded mapMp00130Letter v - 1 is 1 when value v is a descent top: some smaller value immediately follows it.
  • DescentWordPermutation → BinaryWordsurjectionSurjectionGraded mapMp00109Letter i is 1 when the word falls between positions i and i + 1: the descent set as a binary word.
  • FoataPermutation → PermutationbijectionBijectionGraded mapMp00087Foata's fundamental bijection: cycles rotated to their max, ordered by increasing max, parentheses erased.
  • FoataInversionsToMajorPermutation → PermutationbijectioninverseBijectionGraded mapMp00175The inverse of Foata's major-to-inversions bijection: peel off the last letter, rotate the blocks of the rest back.
  • FoataMajorToInversionsPermutation → PermutationbijectioninverseBijectionGraded mapMp00067Foata's bijection: each letter is put on the end of the image so far, which is cut into blocks, and every block is rotated one place right.
  • FromPermutationPermutation → IncreasingBinaryTreeThe increasing binary tree built by minimum-splitting recursion: the position of the smallest value roots the tree, everything before it recurses to the left, everything after it to the right.
  • InversePermutation → PermutationinvolutionBijectionGraded mapInvolutionMp00066The inverse permutation: position of each value.
  • InverseAfterComplementAfterReversePermutation → PermutationReverse, then complement, then invert.
  • InverseCyclicShiftPermutation → PermutationinverseRotate the word one place to the right.
  • InverseFoataPermutation → PermutationbijectioninverseBijectionGraded mapMp00086The permutation whose cycles are the stretches of the word between successive left-to-right maxima, each read as a cycle.
  • InverseKrewerasComplementPermutation → PermutationbijectioninverseBijectionGraded mapMp00089cπ⁻¹ with the long cycle c = (1 2 ... n), FindStat's order: position i holds π⁻¹(c(i)).
  • InverseToricPromotionPermutation → PermutationbijectioninverseBijectionGraded mapMp00309The same swaps as ToricPromotion in the opposite order: n and 1, then n - 1 and n, down to 1 and 2.
  • KnuthClassRepresentativePermutation → PermutationidempotentThe row reading word of σ's RSK insertion tableau — the canonical word of its Knuth (plactic) class.
  • KrewerasComplementPermutation → PermutationbijectionBijectionGraded mapMp00088π⁻¹c with the long cycle c = (1 2 ... n), FindStat's order: position i holds c(π⁻¹(i)).
  • LeftToRightMaximaDyckPathPermutation → DyckPathsurjectionSurjectionGraded mapMp00127The Dyck path whose rises climb to each left-to-right maximum and whose falls run to the next one.
  • LehmerCodeRotationPermutation → PermutationbijectionBijectionGraded mapMp00149The permutation whose Lehmer code is this one's with every entry one larger, cyclically.
  • LehmerCodeToMajorCodePermutation → PermutationbijectioninverseBijectionGraded mapMp00062The permutation whose major code is this permutation's Lehmer code.
  • LongCycleConjugationPermutation → PermutationbijectionBijectionGraded mapMp00265Conjugation by the long cycle (1 2 ... n): each cycle's entries shifted up by one, cyclically.
  • MajorCodeToLehmerCodePermutation → PermutationbijectioninverseBijectionGraded mapMp00073The permutation whose Lehmer code is this permutation's major code.
  • PeakSetPermutation → FinsetThe interior positions that rise then fall.
  • PermutahedronVertexPermutation → FinsetThe vertex (σ(1), …, σ(n)), or its Loday point, is an ordered tuple of coordinates, while finset is an unordered set of positions (the carrier DescentSet and PeakSet use). Reordering the coordinates gives a different vertex but the same finset, so the map would not be injective. A finset-valued PermutahedronVertex is a type mismatch, not a gap to close.
  • ReversePermutation → PermutationinvolutionBijectionGraded mapInvolutionMp00064The word read backwards.
  • ReverseComplementPermutation → PermutationinvolutionReverse, then complement.
  • RskPermutation → StandardTableauPairThe RSK correspondence: the insertion and recording tableaux, as a pair.
  • RskInsertionPermutation → StandardTableausurjectionSurjectionGraded mapMp00059The insertion tableau of the RSK correspondence.
  • RskRecordingPermutation → StandardTableausurjectionSurjectionGraded mapMp00070The recording tableau of the RSK correspondence, as its rows.
  • RskShapePermutation → IntegerPartitionsurjectionSurjectionGraded mapMp00060The common shape of the RSK tableaux: the row lengths, as a partition of n.
  • RunSortPermutation → PermutationidempotentIdempotentGraded mapMp00223The permutation with its increasing runs sorted lexicographically.
  • SignedPermutationPermutation → SignedPermutationInjectionGraded mapMp00170A permutation as the signed permutation with every sign positive.
  • SimionSchmidtPermutation → PermutationidempotentIdempotentGraded mapMp00068The left-to-right minima stay in place and the other positions take the remaining values, largest first: a 123-avoiding permutation.
  • SubexcedantSeqPermutation → SubexcedantSeqinverseEntry i counts the earlier entries larger than p(i): the permutation's inversion sequence.
  • ToLehmerCodePermutation → PermutationInversionEntry i counts the later entries smaller than p(i).
  • ToricPromotionPermutation → PermutationbijectioninverseBijectionGraded mapMp00310Toric promotion of the path graph: swap the values 1 and 2, then 2 and 3, and so on up to n and 1, each swap skipped when the two values sit next to each other.
  • WeakExceedancePartitionPermutation → SetPartitionSurjectionGraded mapMp00240The coarsest set partition containing every arc from i to π(i) with i ≤ π(i).

To Permutation

  • Avoiding132PermutationDyckPath → PermutationInjectionGraded mapMp00025The 132-avoiding permutation of Krattenthaler's bijection, built from the path's area sequence read from the end.
  • Avoiding312PermutationDyckPath → PermutationInjectionGraded mapMp00031The 312-avoiding permutation of Bandlow and Killpatrick: from the identity, each area-sequence entry swaps neighbouring positions that many times.
  • Avoiding321PermutationDyckPath → PermutationInjectionGraded mapMp00024The 321-avoiding permutation whose RSK pair is the pair of two-row tableaux read off the first and last halves of the path.
  • BilleyJockuschStanleyPermutationDyckPath → PermutationInjectionGraded mapMp00129The 321-avoiding permutation with entry (ups through a valley) + 1 at the position of its downs through that valley: the Billey-Jockusch-Stanley bijection.
  • BlockConcatenationSetComposition → PermutationsurjectionSurjectionGraded mapMp00286The permutation that lists the blocks in order, each sorted increasingly.
  • CarPermutationParkingFunction → PermutationSurjectionGraded mapMp00053Spot j holds the car that parks there, each car taking the first free spot at or after its preference.
  • IncreasingCyclePermutationSetPartition → PermutationInjectionGraded mapMp00080The permutation whose cycles are the blocks, each cycle increasing: every element goes to the next larger in its block, the largest to the least.
  • KrattenthalerPermutationDyckPath → PermutationInjectionGraded mapMp00119The 321-avoiding permutation whose left-to-right maxima are the path's peaks: Krattenthaler's bijection.
  • LabelingPermutationParkingFunction → PermutationSurjectionGraded mapMp00055The labeling of the parking function's support Dyck path: the positions of the entries, smallest entry first and equal entries left to right.
  • NoncrossingPermutationDyckPath → PermutationInjectionGraded mapMp00023The noncrossing permutation Stump's bijection gives the path: the cycles of its touch points, peeled off round by round.
  • PermutationCycleDecomposition → PermutationinverseThe permutation a cycle decomposition describes.
  • PermutationSubexcedantSeq → PermutationinverseThe permutation a subexcedant sequence is the inversion sequence of.
  • ReadingWordStandardTableau → PermutationInjectionGraded mapMp00081The rows read left to right, from the bottom row up, as a permutation.
  • RingelDyckPath → PermutationInjectionGraded mapMp00201The Ringel permutation of the Nakayama algebra whose Kupisch series the path gives, one size up.
  • StandardizationSignedPermutation → PermutationsurjectionSurjectionGraded mapMp00245The permutation of the same relative order, taking 1 < … < n < −n < … < −1.
  • StandardPermutationBinaryWord → PermutationGraded mapMp00336The permutation ranking the letters of the word, equal letters from left to right.
  • ToPermutationStandardTableauPair → PermutationinverseThe permutation an RSK pair comes from: inverse RSK.
  • UnderlyingPermutationSignedPermutation → PermutationsurjectionSurjectionGraded mapMp00163The permutation left when the signs are forgotten.
32 more in FindStat, not implemented here
  • Mp00002AlternatingSignMatrix → PermutationSurjectionGraded mapto left key permutation
  • Mp00014BinaryTree → PermutationInjectionGraded mapto 132-avoiding permutation
  • Mp00017BinaryTree → PermutationInjectionGraded mapto 312-avoiding permutation
  • Mp00058PerfectMatching → PermutationInjectionGraded mapto permutation
  • Mp00061Permutation → BinaryTreeSurjectionGraded mapto increasing tree
  • Mp00063Permutation → AlternatingSignMatrixInjectionGraded mapto alternating sign matrix
  • Mp00065Permutation → PosetsGraded mappermutation poset
  • Mp00075SemistandardTableau → PermutationGraded mapreading word permutation
  • Mp00159Permutation → PermutationGraded mapDemazure product with inverse
  • Mp00160Permutation → LabeledGraphGraded mapgraph of inversions
  • Mp00204Permutation → IntegerPartitionSurjectionGraded mapLLPS
  • Mp00208Permutation → Latticeslattice of intervals
  • Mp00209Permutation → Posetspattern poset
  • Mp00235Permutation → PermutationBijectionGraded mapdescent views to invisible inversion bottoms
  • Mp00236Permutation → PermutationBijectionGraded mapClarke-Steingrimsson-Zeng inverse
  • Mp00237Permutation → PermutationBijectionGraded mapdescent views to invisible inversion bottoms
  • Mp00238Permutation → PermutationBijectionGraded mapClarke-Steingrimsson-Zeng
  • Mp00239Permutation → PermutationBijectionGraded mapInvolutionCorteel
  • Mp00241Permutation → PermutationBijectionGraded mapInvolutioninvert Laguerre heap
  • Mp00248Permutation → IntegerCompositionGraded mapDEX composition
  • Mp00252Permutation → PermutationSurjectionrestriction
  • Mp00253DecoratedPermutation → PermutationSurjectionGraded mappermutation
  • Mp00254Permutation → PermutationIdempotentInverse fireworks map
  • Mp00255DecoratedPermutation → PermutationGraded maplower permutation
  • Mp00256DecoratedPermutation → PermutationGraded mapupper permutation
  • Mp00257Permutation → PermutationBijectionGraded mapInvolutionAlexandersson Kebede
  • Mp00277Permutation → PermutationGraded mapcatalanization
  • Mp00283PerfectMatching → PermutationInjectionGraded mapnon-nesting-exceedence permutation
  • Mp00305Permutation → ParkingFunctionInjectionGraded mapparking function
  • Mp00325Permutation → PermutationBijectionGraded mapones to leading
  • Mp00326Permutation → PermutationBijectionGraded mapweak order rowmotion
  • Mp00329Permutation → PermutationBijectionTanimoto

Enumeration

Examples

6 more kept as data, checked against the oracles
Basic #

Count(NonCrossingCycleSupportPermutations(5))=105Count(NonCrossingCycleSupportPermutations(5)) = 105

live ↗
InCount(NonCrossingCycleSupportPermutations(5))\mathrm{Count}(\mathrm{NonCrossingCycleSupportPermutations}(5))Out105105
About
Examples7

See also: NonCrossingPermutations, CatalanNumber, Count, At