Skip to content

SkewStandardTableaux ​

Standard Young tableaux on reduced skew shapes λ/μ\lambda/\mu, summed over every shape with nn cells, as a lazy indexed family.

SkewStandardTableaux(size)the standard fillings of every reduced skew shape λ/μ\lambda/\mu with size cells, entries 1..n1..n each once, increasing along rows and down columns.
Typed signatures
TypePackageApplies
(integer<0..>) -> indexed_collection<list<list<integer>>>combinatoricsalways

Domain: Collections

Details
  • A lazy indexed collection with no closed form, summed over every reduced skew shape from SkewPartitions. A shape's fillings are counted over its order ideals (the cells placed so far), a table with a state for each count of cells left in each row, so a place in the order is found by walking that table; the count is exact, and At answers up to what work allows (the table's steps are the limit).
  • Each element packs [λ, μ, rowWord], where rowWord[i] is the 0-based row entry i+1i{+}1 was placed in, in placement order; μ=0\mu = 0 (every row) recovers a plain standard Young tableau. μ\mu has no zero parts, as in SkewPartitions.
  • Listed by shape (SkewPartitions's λ\lambda-then-μ\mu order), then by row-word, lexicographically within a shape.

Definition

Epsil, as the implementation runs it.

count(_n)

(1 if _n == 0 else 0) if _n < 1 else Fold(
                                           Function(
                                                     ss_b + _tables[(_n + 1) *
                                                                    _n * _n + ss_i + 1],
                                                     ss_b,
                                                     ss_i,
                                                   ),
                                           0,
                                           Range(
                                                  0,
                                                  ((1 if _n == 0 else 0) if _n <
                                                                            1 else Fold(
                                                                                        Function(sc_a +
                                                                                                 Fold(
                                                                                                       Function(sc_b +
                                                                                                                _tables[(_n -
                                                                                                                         (sc_hi - sc_lo +
                                                                                                                          1)) * _n * _n +
                                                                                                                        (sc_lo - 1) *
                                                                                                                        _n +
                                                                                                                        sc_hi], sc_b, sc_lo),
                                                                                                       0,
                                                                                                       Range(1, sc_hi, 1),
                                                                                                     ), sc_a, sc_hi),
                                                                                        0,
                                                                                        Range(1, _n, 1),
                                                                                      )) -
                                                  1,
                                                  1,
                                                ),
                                         )

unrank(_n, _r)

[[], [], []] if _n < 1 else Apply(
                                   (ss_found9: list<integer>) => Apply(
                                                                        (ss_shape17: list<list<integer | nan>>) => Apply((ss_lam: list<integer>) => Apply((ss_mu: list<integer>) => Apply((ss_L: integer) => Apply((ss_len: list<integer>) => Apply(
                                                                                                                                                                                                                                                     (ss_st: list<integer>) => Apply((ss_M: integer) => Apply(
                                                                                                                                                                                                                                                                                                               (ss_f10: list<integer>) => [
                                                                                                                                                                                                                                                                                                                                            ss_lam,
                                                                                                                                                                                                                                                                                                                                            ss_mu,
                                                                                                                                                                                                                                                                                                                                            Drop(Fold(
                                                                                                                                                                                                                                                                                                                                                       Function(Apply(
                                                                                                                                                                                                                                                                                                                                                                       (ss_row13: list<integer>) => Join([ss_row13[1], ss_u11[2] - ss_st[ss_row13[2]]], ReplaceAt(Drop(ss_u11, 2), ss_t18, ss_row13[2] - 1)),
                                                                                                                                                                                                                                                                                                                                                                       Fold(Function(ss_pick12 if ss_pick12[2] != 0 else Apply(
                                                                                                                                                                                                                                                                                                                                                                                                                                (ss_w14: integer) => [ss_pick12[1], ss_r15] if ss_pick12[1] < ss_w14 else [ss_pick12[1] - ss_w14, 0],
                                                                                                                                                                                                                                                                                                                                                                                                                                ss_f10[ss_u11[2] - ss_st[ss_r15] +
                                                                                                                                                                                                                                                                                                                                                                                                                                       1],
                                                                                                                                                                                                                                                                                                                                                                                                                              ) if Apply((ss_d19: integer) => ss_d19 >= 1 &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                             (True if ss_r15 == 1 else (ss_u11[2] -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ss_u11[2] %
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ss_st[ss_r15 - 1]) /
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ss_st[ss_r15 - 1] %
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       (ss_len[ss_r15 - 1] +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        1) <=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ss_lam[ss_r15 - 1] -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ss_lam[ss_r15] +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ss_d19 -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       1), (ss_u11[2] -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                ss_u11[2] % ss_st[ss_r15]) /
                                                                                                                                                                                                                                                                                                                                                                                                                                                               ss_st[ss_r15] %
                                                                                                                                                                                                                                                                                                                                                                                                                                                               (ss_len[ss_r15] + 1)) else ss_pick12, ss_pick12, ss_r15), [ss_u11[1], 0], Range(1, ss_L, 1)),
                                                                                                                                                                                                                                                                                                                                                                     ), ss_u11, ss_t18),
                                                                                                                                                                                                                                                                                                                                                       Join([ss_found9[1], ss_M - 1], Map(Function(0, ss_z), Range(1, _n, 1))),
                                                                                                                                                                                                                                                                                                                                                       Range(1, _n, 1),
                                                                                                                                                                                                                                                                                                                                                     ), 2),
                                                                                                                                                                                                                                                                                                                                          ],
                                                                                                                                                                                                                                                                                                               Fold(
                                                                                                                                                                                                                                                                                                                     Function(ReplaceAt(
                                                                                                                                                                                                                                                                                                                                         ss_f20,
                                                                                                                                                                                                                                                                                                                                         ss_p21 + 1,
                                                                                                                                                                                                                                                                                                                                         Fold(Function(ss_a23 +
                                                                                                                                                                                                                                                                                                                                                       (ss_f20[ss_p21 - ss_st[ss_r22] +
                                                                                                                                                                                                                                                                                                                                                               1] if Apply((ss_d24: integer) => ss_d24 >= 1 &&
                                                                                                                                                                                                                                                                                                                                                                                               (True if ss_r22 == 1 else (ss_p21 -
                                                                                                                                                                                                                                                                                                                                                                                                                          ss_p21 %
                                                                                                                                                                                                                                                                                                                                                                                                                          ss_st[ss_r22 - 1]) /
                                                                                                                                                                                                                                                                                                                                                                                                                         ss_st[ss_r22 - 1] %
                                                                                                                                                                                                                                                                                                                                                                                                                         (ss_len[ss_r22 - 1] +
                                                                                                                                                                                                                                                                                                                                                                                                                          1) <=
                                                                                                                                                                                                                                                                                                                                                                                                                         ss_lam[ss_r22 - 1] -
                                                                                                                                                                                                                                                                                                                                                                                                                         ss_lam[ss_r22] +
                                                                                                                                                                                                                                                                                                                                                                                                                         ss_d24 -
                                                                                                                                                                                                                                                                                                                                                                                                                         1), (ss_p21 -
                                                                                                                                                                                                                                                                                                                                                                                                  ss_p21 % ss_st[ss_r22]) /
                                                                                                                                                                                                                                                                                                                                                                                                 ss_st[ss_r22] %
                                                                                                                                                                                                                                                                                                                                                                                                 (ss_len[ss_r22] + 1)) else 0), ss_a23, ss_r22), 0, Range(1, ss_L, 1)),
                                                                                                                                                                                                                                                                                                                                       ), ss_f20, ss_p21),
                                                                                                                                                                                                                                                                                                                     ReplaceAt(Map(Function(0, ss_z), Range(1, ss_M, 1)), 1, 1),
                                                                                                                                                                                                                                                                                                                     Range(1, ss_M - 1, 1),
                                                                                                                                                                                                                                                                                                                   ),
                                                                                                                                                                                                                                                                                                             ), ss_st[ss_L] *
                                                                                                                                                                                                                                                                                                               (ss_len[ss_L] + 1)),
                                                                                                                                                                                                                                                     Fold(Function(Join(ss_s26, [ss_s26[ss_i25 - 1] *
                                                                                                                                                                                                                                                                                 (ss_len[ss_i25 - 1] +
                                                                                                                                                                                                                                                                                  1)]), ss_s26, ss_i25), [1], Range(2, ss_L, 1)),
                                                                                                                                                                                                                                                   ), Map(Function(ss_lam[ss_i27] -
                                                                                                                                                                                                                                                                  (ss_mu[ss_i27] if ss_i27 <= Length(ss_mu) else 0), ss_i27), Range(1, ss_L, 1))), Length(ss_lam)), ss_shape17[2]), ss_shape17[1]),
                                                                        Apply((ss_ix: integer) => [[], []] if _n < 1 else Apply(
                                                                                                                                 (sp_p1: list<integer>) => Apply(
                                                                                                                                                                  (sp_bs: list<integer>) => Apply((sp_rows: integer) => Apply(
                                                                                                                                                                                                                               (sp_h: list<integer>) => Apply(
                                                                                                                                                                                                                                                               (sp_p2: list<integer>) => Apply((sp_as: list<integer>) => [
                                                                                                                                                                                                                                                                                                                           Take(sp_bs, sp_rows),
                                                                                                                                                                                                                                                                                                                           Take(
                                                                                                                                                                                                                                                                                                                                 Map(Function(sp_as[sp_i] - 1, sp_i), Range(1, sp_rows, 1)),
                                                                                                                                                                                                                                                                                                                                 Fold(Function(sp_n +
                                                                                                                                                                                                                                                                                                                                               (1 if sp_as[sp_i] > 1 else 0), sp_n, sp_i), 0, Range(1, sp_rows, 1)),
                                                                                                                                                                                                                                                                                                                               ),
                                                                                                                                                                                                                                                                                                                         ], Drop(sp_p2, 3)),
                                                                                                                                                                                                                                                               Fold(
                                                                                                                                                                                                                                                                     Function(sp_q if sp_t > sp_rows else Apply((sp_b: integer) => Apply(
                                                                                                                                                                                                                                                                                                                                          (sp_fd: list<integer>) => Join([sp_fd[1], sp_q[2] +
                                                                                                                                                                                                                                                                                                                                                                                    sp_b - sp_fd[2] +
                                                                                                                                                                                                                                                                                                                                                                                    1, sp_fd[2]], ReplaceAt(Drop(sp_q, 3), sp_t, sp_fd[2])),
                                                                                                                                                                                                                                                                                                                                          Fold(Function(sp_f if sp_f[2] > 0 else Apply(
                                                                                                                                                                                                                                                                                                                                                                                        (sp_size: integer) => [sp_f[1], sp_o] if sp_f[1] < sp_size else [sp_f[1] - sp_size, 0],
                                                                                                                                                                                                                                                                                                                                                                                        0 if _n - sp_q[2] -
                                                                                                                                                                                                                                                                                                                                                                                             (sp_b - sp_o +
                                                                                                                                                                                                                                                                                                                                                                                              1) <
                                                                                                                                                                                                                                                                                                                                                                                             0 else sp_h[(sp_rows - sp_t) *
                                                                                                                                                                                                                                                                                                                                                                                                        (_n + 1) *
                                                                                                                                                                                                                                                                                                                                                                                                        (_n + 1) +
                                                                                                                                                                                                                                                                                                                                                                                                        sp_o *
                                                                                                                                                                                                                                                                                                                                                                                                        (_n + 1) +
                                                                                                                                                                                                                                                                                                                                                                                                        (_n - sp_q[2] -
                                                                                                                                                                                                                                                                                                                                                                                                         (sp_b - sp_o +
                                                                                                                                                                                                                                                                                                                                                                                                          1)) +
                                                                                                                                                                                                                                                                                                                                                                                                        1],
                                                                                                                                                                                                                                                                                                                                                                                      ), sp_f, sp_o), [sp_q[1], 0], Range(1, Min(sp_b, sp_q[3]), 1)),
                                                                                                                                                                                                                                                                                                                                        ), sp_bs[sp_t]), sp_q, sp_t),
                                                                                                                                                                                                                                                                     Join([sp_p1[1], 0, _n], Map(Function(0, sp_z), Range(1, _n, 1))),
                                                                                                                                                                                                                                                                     Range(1, _n, 1),
                                                                                                                                                                                                                                                                   ),
                                                                                                                                                                                                                                                             ),
                                                                                                                                                                                                                               Fold(Function(Join(
                                                                                                                                                                                                                                                   sp_h,
                                                                                                                                                                                                                                                   ReplaceAt(Map(Function(0, sp_z), Range(1, (_n + 1) *
                                                                                                                                                                                                                                                                                             (_n + 1), 1)), _n + 1 +
                                                                                                                                                                                                                                                                                                    1, 1) if sp_j == 0 else Apply((sp_below: integer) => Apply(
                                                                                                                                                                                                                                                                                                                                                               (sp_prev: list<integer>) => Map(Function(Apply(
                                                                                                                                                                                                                                                                                                                                                                                                               (sp_a: integer) => Apply((sp_c: integer) => Fold(Function(sp_s +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                         (sp_prev[sp_a2 *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  (_n + 1) +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  (sp_c -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   (sp_below - sp_a2 +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    1)) +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1] if sp_c >=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       sp_below - sp_a2 +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       1 else 0), sp_s, sp_a2), 0, Range(1, Min(sp_below, sp_a), 1)) if sp_a >= 1 &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 sp_a <=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 sp_below + 1 else 0, sp_i %
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          (_n + 1)),
                                                                                                                                                                                                                                                                                                                                                                                                               (sp_i -
                                                                                                                                                                                                                                                                                                                                                                                                                sp_i %
                                                                                                                                                                                                                                                                                                                                                                                                                (_n + 1)) /
                                                                                                                                                                                                                                                                                                                                                                                                               (_n + 1),
                                                                                                                                                                                                                                                                                                                                                                                                             ), sp_i), Range(0, (_n + 1) *
                                                                                                                                                                                                                                                                                                                                                                                                                               (_n + 1) -
                                                                                                                                                                                                                                                                                                                                                                                                                               1, 1)),
                                                                                                                                                                                                                                                                                                                                                               Drop(sp_h, (sp_j - 1) *
                                                                                                                                                                                                                                                                                                                                                                          (_n + 1) *
                                                                                                                                                                                                                                                                                                                                                                          (_n + 1)),
                                                                                                                                                                                                                                                                                                                                                             ), sp_bs[sp_rows - sp_j +
                                                                                                                                                                                                                                                                                                                                                                     1]),
                                                                                                                                                                                                                                                 ), sp_h, sp_j), [], Range(0, sp_rows - 1, 1)),
                                                                                                                                                                                                                             ), Fold(Function(sr_a +
                                                                                                                                                                                                                                             (1 if sp_bs[sr_i] > 0 else 0), sr_a, sr_i), 0, Range(1, _n, 1))),
                                                                                                                                                                  Drop(sp_p1, 2 +
                                                                                                                                                                              (_n + 1) *
                                                                                                                                                                              (_n + 1)),
                                                                                                                                                                ),
                                                                                                                                 Fold(
                                                                                                                                       Function(sp_st if sp_st[2] == 0 else Apply(
                                                                                                                                                                                   (sp_g: list<integer>) => Apply((sp_bs: list<integer>) => Apply(
                                                                                                                                                                                                                                                   (sp_end: integer) => Join([sp_st[1], 0], sp_g, sp_bs) if sp_st[1] < sp_end else Apply(
                                                                                                                                                                                                                                                                                                                                          (sp_fd: list<integer>) => Join(
                                                                                                                                                                                                                                                                                                                                                                          [sp_fd[1], sp_fd[2]],
                                                                                                                                                                                                                                                                                                                                                                          Map(
                                                                                                                                                                                                                                                                                                                                                                               Function(Apply((sp_a1: integer) => Apply(
                                                                                                                                                                                                                                                                                                                                                                                                                         (sp_c1: integer) => Apply((sp_k: integer) => Fold(Function(sp_s +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    sp_g[sp_a *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         (_n + 1) +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         (sp_c1 - sp_k) +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         1], sp_s, sp_a), 0, Range(0 if sp_t == 1 else sp_a1, 0 if sp_t == 1 else Min(sp_fd[2] + 1, _n), 1)) if sp_c1 >= sp_k else 0, sp_fd[2] - sp_a1 +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               1) if sp_a1 >= 1 &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    sp_a1 <= sp_fd[2] else 0,
                                                                                                                                                                                                                                                                                                                                                                                                                         sp_i %
                                                                                                                                                                                                                                                                                                                                                                                                                         (_n + 1),
                                                                                                                                                                                                                                                                                                                                                                                                                       ), (sp_i -
                                                                                                                                                                                                                                                                                                                                                                                                                          sp_i %
                                                                                                                                                                                                                                                                                                                                                                                                                          (_n + 1)) /
                                                                                                                                                                                                                                                                                                                                                                                                                         (_n + 1)), sp_i),
                                                                                                                                                                                                                                                                                                                                                                               Range(0, (_n + 1) *
                                                                                                                                                                                                                                                                                                                                                                                        (_n + 1) -
                                                                                                                                                                                                                                                                                                                                                                                        1, 1),
                                                                                                                                                                                                                                                                                                                                                                             ),
                                                                                                                                                                                                                                                                                                                                                                          ReplaceAt(sp_bs, sp_t, sp_fd[2]),
                                                                                                                                                                                                                                                                                                                                                                        ),
                                                                                                                                                                                                                                                                                                                                          Fold(Function(sp_f if sp_f[2] > 0 else Apply(
                                                                                                                                                                                                                                                                                                                                                                                        (sp_size: integer) => [sp_f[1], sp_o] if sp_f[1] < sp_size else [sp_f[1] - sp_size, 0],
                                                                                                                                                                                                                                                                                                                                                                                        Fold(Function(sp_w +
                                                                                                                                                                                                                                                                                                                                                                                                      Apply((sp_k: integer) => Fold(Function(sp_u +
                                                                                                                                                                                                                                                                                                                                                                                                                                             Fold(Function(sp_v +
                                                                                                                                                                                                                                                                                                                                                                                                                                                           sp_g[sp_a *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                (_n + 1) + sp_c + 1] *
                                                                                                                                                                                                                                                                                                                                                                                                                                                           _tables[(_n - sp_c -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                    sp_k) * _n * _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   (sp_b - 1) *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   sp_o], sp_v, sp_c), 0, Range(0, _n - sp_k, 1)), sp_u, sp_a), 0, Range(0 if sp_t == 1 else sp_b, 0 if sp_t == 1 else Min(sp_o + 1, _n), 1)), sp_o - sp_b +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           1), sp_w, sp_b), 0, Range(1, sp_o, 1)),
                                                                                                                                                                                                                                                                                                                                                                                      ), sp_f, sp_o), [sp_st[1] - sp_end, 0], Range(1, sp_st[2], 1)),
                                                                                                                                                                                                                                                                                                                                        ),
                                                                                                                                                                                                                                                   sp_g[(0 if sp_t == 1 else 1) *
                                                                                                                                                                                                                                                        (_n + 1) + _n + 1],
                                                                                                                                                                                                                                                 ), Drop(sp_st, 2 +
                                                                                                                                                                                                                                                               (_n + 1) *
                                                                                                                                                                                                                                                               (_n + 1))),
                                                                                                                                                                                   Take(Drop(sp_st, 2), (_n + 1) *
                                                                                                                                                                                                        (_n + 1)),
                                                                                                                                                                                 ), sp_st, sp_t),
                                                                                                                                       Join(
                                                                                                                                             [ss_ix, _n],
                                                                                                                                             ReplaceAt(Map(
                                                                                                                                                            Function(0, sp_z),
                                                                                                                                                            Range(1, (_n + 1) *
                                                                                                                                                                     (_n + 1), 1),
                                                                                                                                                          ), 1, 1),
                                                                                                                                             Map(Function(0, sp_z), Range(1, _n, 1)),
                                                                                                                                           ),
                                                                                                                                       Range(1, _n, 1),
                                                                                                                                     ),
                                                                                                                               ), ss_found9[2]),
                                                                      ),
                                   Fold(
                                         Function(ss_state16 if ss_state16[2] >=
                                                                0 else Apply(
                                                                             (ss_w14: integer) => [ss_state16[1], ss_i] if ss_state16[1] < ss_w14 else [ss_state16[1] - ss_w14, -1],
                                                                             _tables[(_n + 1) *
                                                                                     _n *
                                                                                     _n + ss_i + 1],
                                                                           ), ss_state16, ss_i),
                                         [_r, -1],
                                         Range(0, ((1 if _n == 0 else 0) if _n <
                                                                            1 else Fold(
                                                                                        Function(sc_a +
                                                                                                 Fold(
                                                                                                       Function(sc_b +
                                                                                                                _tables[(_n -
                                                                                                                         (sc_hi - sc_lo +
                                                                                                                          1)) * _n * _n +
                                                                                                                        (sc_lo - 1) *
                                                                                                                        _n +
                                                                                                                        sc_hi], sc_b, sc_lo),
                                                                                                       0,
                                                                                                       Range(1, sc_hi, 1),
                                                                                                     ), sc_a, sc_hi),
                                                                                        0,
                                                                                        Range(1, _n, 1),
                                                                                      )) -
                                                  1, 1),
                                       ),
                                 )

rank(_n, _x)

0 if _n < 1 else Apply((ss_pair30: list<list<integer>>) => Apply(
                                                                  (ss_place31: integer) => Apply((ss_lam: list<integer>) => Apply((ss_mu: list<integer>) => Apply((ss_L: integer) => Apply(
                                                                                                                                                                                            (ss_len: list<integer>) => Apply(
                                                                                                                                                                                                                              (ss_st: list<integer>) => Apply((ss_M: integer) => Apply(
                                                                                                                                                                                                                                                                                        (ss_f28: list<integer>) => Fold(Function(ss_before33 +
                                                                                                                                                                                                                                                                                                                                 _tables[(_n + 1) * _n * _n + ss_i36 + 1], ss_before33, ss_i36), 0, Range(0, ss_place31 - 1, 1)) +
                                                                                                                                                                                                                                                                                                                   Fold(Function([ss_u29[1] +
                                                                                                                                                                                                                                                                                                                                  Fold(Function(ss_a35 +
                                                                                                                                                                                                                                                                                                                                                (ss_f28[ss_u29[2] - ss_st[ss_r34] +
                                                                                                                                                                                                                                                                                                                                                        1] if Apply((ss_d37: integer) => ss_d37 >= 1 &&
                                                                                                                                                                                                                                                                                                                                                                                        (True if ss_r34 == 1 else (ss_u29[2] -
                                                                                                                                                                                                                                                                                                                                                                                                                   ss_u29[2] %
                                                                                                                                                                                                                                                                                                                                                                                                                   ss_st[ss_r34 - 1]) /
                                                                                                                                                                                                                                                                                                                                                                                                                  ss_st[ss_r34 - 1] %
                                                                                                                                                                                                                                                                                                                                                                                                                  (ss_len[ss_r34 - 1] +
                                                                                                                                                                                                                                                                                                                                                                                                                   1) <=
                                                                                                                                                                                                                                                                                                                                                                                                                  ss_lam[ss_r34 - 1] -
                                                                                                                                                                                                                                                                                                                                                                                                                  ss_lam[ss_r34] +
                                                                                                                                                                                                                                                                                                                                                                                                                  ss_d37 -
                                                                                                                                                                                                                                                                                                                                                                                                                  1), (ss_u29[2] -
                                                                                                                                                                                                                                                                                                                                                                                           ss_u29[2] % ss_st[ss_r34]) /
                                                                                                                                                                                                                                                                                                                                                                                          ss_st[ss_r34] %
                                                                                                                                                                                                                                                                                                                                                                                          (ss_len[ss_r34] + 1)) else 0), ss_a35, ss_r34), 0, Range(1, _x[3][ss_t32] + 1 -
                                                                                                                                                                                                                                                                                                                                                                               1, 1)), ss_u29[2] -
                                                                                                                                                                                                                                                                                                                                    ss_st[_x[3][ss_t32] + 1]], ss_u29, ss_t32), [0, ss_M - 1], Range(1, _n, 1))[1],
                                                                                                                                                                                                                                                                                        Fold(
                                                                                                                                                                                                                                                                                              Function(ReplaceAt(
                                                                                                                                                                                                                                                                                                                  ss_f38,
                                                                                                                                                                                                                                                                                                                  ss_p39 + 1,
                                                                                                                                                                                                                                                                                                                  Fold(Function(ss_a41 +
                                                                                                                                                                                                                                                                                                                                (ss_f38[ss_p39 - ss_st[ss_r40] +
                                                                                                                                                                                                                                                                                                                                        1] if Apply((ss_d42: integer) => ss_d42 >= 1 &&
                                                                                                                                                                                                                                                                                                                                                                        (True if ss_r40 == 1 else (ss_p39 -
                                                                                                                                                                                                                                                                                                                                                                                                   ss_p39 %
                                                                                                                                                                                                                                                                                                                                                                                                   ss_st[ss_r40 - 1]) /
                                                                                                                                                                                                                                                                                                                                                                                                  ss_st[ss_r40 - 1] %
                                                                                                                                                                                                                                                                                                                                                                                                  (ss_len[ss_r40 - 1] +
                                                                                                                                                                                                                                                                                                                                                                                                   1) <=
                                                                                                                                                                                                                                                                                                                                                                                                  ss_lam[ss_r40 - 1] -
                                                                                                                                                                                                                                                                                                                                                                                                  ss_lam[ss_r40] +
                                                                                                                                                                                                                                                                                                                                                                                                  ss_d42 -
                                                                                                                                                                                                                                                                                                                                                                                                  1), (ss_p39 -
                                                                                                                                                                                                                                                                                                                                                                           ss_p39 % ss_st[ss_r40]) /
                                                                                                                                                                                                                                                                                                                                                                          ss_st[ss_r40] %
                                                                                                                                                                                                                                                                                                                                                                          (ss_len[ss_r40] + 1)) else 0), ss_a41, ss_r40), 0, Range(1, ss_L, 1)),
                                                                                                                                                                                                                                                                                                                ), ss_f38, ss_p39),
                                                                                                                                                                                                                                                                                              ReplaceAt(Map(Function(0, ss_z), Range(1, ss_M, 1)), 1, 1),
                                                                                                                                                                                                                                                                                              Range(1, ss_M - 1, 1),
                                                                                                                                                                                                                                                                                            ),
                                                                                                                                                                                                                                                                                      ), ss_st[ss_L] *
                                                                                                                                                                                                                                                                                        (ss_len[ss_L] + 1)),
                                                                                                                                                                                                                              Fold(Function(Join(ss_s44, [ss_s44[ss_i43 - 1] *
                                                                                                                                                                                                                                                          (ss_len[ss_i43 - 1] +
                                                                                                                                                                                                                                                           1)]), ss_s44, ss_i43), [1], Range(2, ss_L, 1)),
                                                                                                                                                                                                                            ),
                                                                                                                                                                                            Map(Function(ss_lam[ss_i45] -
                                                                                                                                                                                                         (ss_mu[ss_i45] if ss_i45 <= Length(ss_mu) else 0), ss_i45), Range(1, ss_L, 1)),
                                                                                                                                                                                          ), Length(ss_lam)), ss_pair30[2]), ss_pair30[1]),
                                                                  0 if _n < 1 else Apply((sp_lam: list<integer>) => Apply((sp_mu: list<integer>) => Apply((sp_rows: integer) => Apply(
                                                                                                                                                                                       (sp_p1: list<integer>) => Apply(
                                                                                                                                                                                                                        (sp_h: list<integer>) => Fold(
                                                                                                                                                                                                                                                       Function(Apply((sp_b: integer) => Apply((sp_a: integer) => [sp_q[1] +
                                                                                                                                                                                                                                                                                                                   Fold(Function(sp_x +
                                                                                                                                                                                                                                                                                                                                 (0 if _n - sp_q[2] -
                                                                                                                                                                                                                                                                                                                                       (sp_b - sp_o +
                                                                                                                                                                                                                                                                                                                                        1) <
                                                                                                                                                                                                                                                                                                                                       0 else sp_h[(sp_rows - sp_t) *
                                                                                                                                                                                                                                                                                                                                                  (_n + 1) *
                                                                                                                                                                                                                                                                                                                                                  (_n + 1) +
                                                                                                                                                                                                                                                                                                                                                  sp_o *
                                                                                                                                                                                                                                                                                                                                                  (_n + 1) +
                                                                                                                                                                                                                                                                                                                                                  (_n - sp_q[2] -
                                                                                                                                                                                                                                                                                                                                                   (sp_b - sp_o +
                                                                                                                                                                                                                                                                                                                                                    1)) +
                                                                                                                                                                                                                                                                                                                                                  1]), sp_x, sp_o), 0, Range(1, Min(sp_a - 1, sp_b, sp_q[3]), 1)), sp_q[2] +
                                                                                                                                                                                                                                                                                                                     sp_b - sp_a +
                                                                                                                                                                                                                                                                                                                     1, sp_a], (sp_mu[sp_t] if sp_t <= Length(sp_mu) else 0) +
                                                                                                                                                                                                                                                                                                                              1), sp_lam[sp_t]), sp_q, sp_t),
                                                                                                                                                                                                                                                       [sp_p1[1], 0, _n],
                                                                                                                                                                                                                                                       Range(1, sp_rows, 1),
                                                                                                                                                                                                                                                     )[1],
                                                                                                                                                                                                                        Fold(Function(Join(
                                                                                                                                                                                                                                            sp_h,
                                                                                                                                                                                                                                            ReplaceAt(Map(Function(0, sp_z), Range(1, (_n + 1) *
                                                                                                                                                                                                                                                                                      (_n + 1), 1)), _n + 1 +
                                                                                                                                                                                                                                                                                             1, 1) if sp_j == 0 else Apply((sp_below: integer) => Apply(
                                                                                                                                                                                                                                                                                                                                                        (sp_prev: list<integer>) => Map(Function(Apply(
                                                                                                                                                                                                                                                                                                                                                                                                        (sp_a: integer) => Apply((sp_c: integer) => Fold(Function(sp_s +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                  (sp_prev[sp_a2 *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                           (_n + 1) +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                           (sp_c -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            (sp_below - sp_a2 +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                             1)) +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                           1] if sp_c >=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                sp_below - sp_a2 +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1 else 0), sp_s, sp_a2), 0, Range(1, Min(sp_below, sp_a), 1)) if sp_a >= 1 &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          sp_a <=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          sp_below + 1 else 0, sp_i %
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   (_n + 1)),
                                                                                                                                                                                                                                                                                                                                                                                                        (sp_i -
                                                                                                                                                                                                                                                                                                                                                                                                         sp_i %
                                                                                                                                                                                                                                                                                                                                                                                                         (_n + 1)) /
                                                                                                                                                                                                                                                                                                                                                                                                        (_n + 1),
                                                                                                                                                                                                                                                                                                                                                                                                      ), sp_i), Range(0, (_n + 1) *
                                                                                                                                                                                                                                                                                                                                                                                                                        (_n + 1) -
                                                                                                                                                                                                                                                                                                                                                                                                                        1, 1)),
                                                                                                                                                                                                                                                                                                                                                        Drop(sp_h, (sp_j - 1) *
                                                                                                                                                                                                                                                                                                                                                                   (_n + 1) *
                                                                                                                                                                                                                                                                                                                                                                   (_n + 1)),
                                                                                                                                                                                                                                                                                                                                                      ), sp_lam[sp_rows - sp_j +
                                                                                                                                                                                                                                                                                                                                                               1]),
                                                                                                                                                                                                                                          ), sp_h, sp_j), [], Range(0, sp_rows - 1, 1)),
                                                                                                                                                                                                                      ),
                                                                                                                                                                                       Fold(
                                                                                                                                                                                             Function(Apply((sp_g: list<integer>) => Apply((sp_bt: integer) => Join([sp_st[1] +
                                                                                                                                                                                                                                                                     sp_g[(0 if sp_t == 1 else 1) *
                                                                                                                                                                                                                                                                          (_n + 1) + _n + 1] +
                                                                                                                                                                                                                                                                     Fold(Function(sp_x +
                                                                                                                                                                                                                                                                                   Fold(Function(sp_w +
                                                                                                                                                                                                                                                                                                 Apply(
                                                                                                                                                                                                                                                                                                        (sp_k: integer) => Fold(Function(sp_u +
                                                                                                                                                                                                                                                                                                                                         Fold(Function(sp_v +
                                                                                                                                                                                                                                                                                                                                                       sp_g[sp_a *
                                                                                                                                                                                                                                                                                                                                                            (_n + 1) + sp_c + 1] *
                                                                                                                                                                                                                                                                                                                                                       _tables[(_n - sp_c -
                                                                                                                                                                                                                                                                                                                                                                sp_k) * _n * _n +
                                                                                                                                                                                                                                                                                                                                                               (sp_b - 1) *
                                                                                                                                                                                                                                                                                                                                                               _n +
                                                                                                                                                                                                                                                                                                                                                               sp_o], sp_v, sp_c), 0, Range(0, _n - sp_k, 1)), sp_u, sp_a), 0, Range(0 if sp_t == 1 else sp_b, 0 if sp_t == 1 else Min(sp_o + 1, _n), 1)),
                                                                                                                                                                                                                                                                                                        sp_o - sp_b +
                                                                                                                                                                                                                                                                                                        1,
                                                                                                                                                                                                                                                                                                      ), sp_w, sp_b), 0, Range(1, sp_o, 1)), sp_x, sp_o), 0, Range(1, sp_bt - 1, 1))], Map(Function(Apply(
                                                                                                                                                                                                                                                                                            (sp_a1: integer) => Apply((sp_c1: integer) => Apply(
                                                                                                                                                                                                                                                                                                                                                 (sp_k: integer) => Fold(Function(sp_s +
                                                                                                                                                                                                                                                                                                                                                                                  sp_g[sp_a *
                                                                                                                                                                                                                                                                                                                                                                                       (_n + 1) +
                                                                                                                                                                                                                                                                                                                                                                                       (sp_c1 - sp_k) +
                                                                                                                                                                                                                                                                                                                                                                                       1], sp_s, sp_a), 0, Range(0 if sp_t == 1 else sp_a1, 0 if sp_t == 1 else Min(sp_bt + 1, _n), 1)) if sp_c1 >= sp_k else 0,
                                                                                                                                                                                                                                                                                                                                                 sp_bt - sp_a1 +
                                                                                                                                                                                                                                                                                                                                                 1,
                                                                                                                                                                                                                                                                                                                                               ) if sp_a1 >= 1 &&
                                                                                                                                                                                                                                                                                                                                                   sp_a1 <= sp_bt else 0, sp_i %
                                                                                                                                                                                                                                                                                                                                                            (_n + 1)),
                                                                                                                                                                                                                                                                                            (sp_i -
                                                                                                                                                                                                                                                                                             sp_i %
                                                                                                                                                                                                                                                                                             (_n + 1)) /
                                                                                                                                                                                                                                                                                            (_n + 1),
                                                                                                                                                                                                                                                                                          ), sp_i), Range(0, (_n + 1) *
                                                                                                                                                                                                                                                                                                            (_n + 1) -
                                                                                                                                                                                                                                                                                                            1, 1))), sp_lam[sp_t]), Drop(sp_st, 1)), sp_st, sp_t),
                                                                                                                                                                                             Join([0], ReplaceAt(Map(Function(0, sp_z), Range(1, (_n + 1) *
                                                                                                                                                                                                                                                 (_n + 1), 1)), 1, 1)),
                                                                                                                                                                                             Range(1, sp_rows, 1),
                                                                                                                                                                                           ),
                                                                                                                                                                                     ), Length(sp_lam)), ss_pair30[2]), ss_pair30[1]),
                                                                ), [_x[1], _x[2]])

valid(_n, _x)

Apply(
       (ss_pair46: list<list<integer>>) => ((True if _n == 0 else Apply((ss_lam: list<integer>) => Apply((ss_mu: list<integer>) => Apply((ss_L: integer) => Apply(
                                                                                                                                                                   (ss_len: list<integer>) => Apply(
                                                                                                                                                                                                     (ss_mus49: list<integer>) => Fold(
                                                                                                                                                                                                                                        Function(Apply((ss_e48: integer) => ss_state47 if ss_state47[1] == 0 else (ReplaceAt(ss_state47, ss_e48 + 1 +
                                                                                                                                                                                                                                                                                                                                         1, ss_state47[ss_e48 + 1 +
                                                                                                                                                                                                                                                                                                                                                      1] +
                                                                                                                                                                                                                                                                                                                                           1) if ss_state47[ss_e48 + 1 +
                                                                                                                                                                                                                                                                                                                                                           1] <
                                                                                                                                                                                                                                                                                                                                                ss_len[ss_e48 + 1] &&
                                                                                                                                                                                                                                                                                                                                                (True if ss_e48 + 1 ==
                                                                                                                                                                                                                                                                                                                                                         1 else ss_mus49[ss_e48 + 1 -
                                                                                                                                                                                                                                                                                                                                                                        1] +
                                                                                                                                                                                                                                                                                                                                                               ss_state47[ss_e48 + 1 -
                                                                                                                                                                                                                                                                                                                                                                          1 +
                                                                                                                                                                                                                                                                                                                                                                          1] >=
                                                                                                                                                                                                                                                                                                                                                               ss_mus49[ss_e48 + 1] +
                                                                                                                                                                                                                                                                                                                                                               ss_state47[ss_e48 + 1 +
                                                                                                                                                                                                                                                                                                                                                                          1] +
                                                                                                                                                                                                                                                                                                                                                               1) else Join([0], Map(Function(0, ss_z), Range(1, ss_L, 1)))) if ss_e48 >= 0 &&
                                                                                                                                                                                                                                                                                                                                                                                                               ss_e48 < ss_L else Join([0], Map(Function(0, ss_z), Range(1, ss_L, 1))), _x[3][ss_t50]), ss_state47, ss_t50),
                                                                                                                                                                                                                                        Join([1], Map(Function(0, ss_z), Range(1, ss_L, 1))),
                                                                                                                                                                                                                                        Range(1, Length(_x[3]), 1),
                                                                                                                                                                                                                                      )[1] ==
                                                                                                                                                                                                                                  1,
                                                                                                                                                                                                     Join(ss_mu, Map(Function(0, ss_z), Range(1, ss_L - Length(ss_mu), 1))),
                                                                                                                                                                                                   ),
                                                                                                                                                                   Map(Function(ss_lam[ss_i51] -
                                                                                                                                                                                (ss_mu[ss_i51] if ss_i51 <= Length(ss_mu) else 0), ss_i51), Range(1, ss_L, 1)),
                                                                                                                                                                 ), Length(ss_lam)), ss_pair46[2]), ss_pair46[1])) if Length(_x[3]) == _n else False) if (Apply((sv_lam: list<integer>) => Length(ss_pair46[2]) <= Length(sv_lam) &&
                                                                                                                                                                                                                                                                                          Fold(Function(ok_sv_i &&
                                                                                                                                                                                                                                                                                                        sv_lam[sv_i] >= 1, ok_sv_i, sv_i), True, Range(1, Length(sv_lam), 1)) &&
                                                                                                                                                                                                                                                                                          Fold(Function(ok_sv_j &&
                                                                                                                                                                                                                                                                                                        sv_lam[sv_j] <=
                                                                                                                                                                                                                                                                                                        sv_lam[sv_j - 1], ok_sv_j, sv_j), True, Range(2, Length(sv_lam), 1)) &&
                                                                                                                                                                                                                                                                                          Fold(Function(ok_sv_k &&
                                                                                                                                                                                                                                                                                                        ss_pair46[2][sv_k] >= 1, ok_sv_k, sv_k), True, Range(1, Length(ss_pair46[2]), 1)) &&
                                                                                                                                                                                                                                                                                          Fold(Function(ok_sv_l &&
                                                                                                                                                                                                                                                                                                        ss_pair46[2][sv_l] <=
                                                                                                                                                                                                                                                                                                        ss_pair46[2][sv_l - 1], ok_sv_l, sv_l), True, Range(2, Length(ss_pair46[2]), 1)) &&
                                                                                                                                                                                                                                                                                          Fold(Function(ok_sv_m &&
                                                                                                                                                                                                                                                                                                        ss_pair46[2][sv_m] < sv_lam[sv_m], ok_sv_m, sv_m), True, Range(1, Length(ss_pair46[2]), 1)) &&
                                                                                                                                                                                                                                                                                          (Length(sv_lam) == 0 ||
                                                                                                                                                                                                                                                                                           Length(ss_pair46[2]) < Length(sv_lam)) &&
                                                                                                                                                                                                                                                                                          Fold(Function(ok_sv_o &&
                                                                                                                                                                                                                                                                                                        ss_pair46[2][sv_o] <=
                                                                                                                                                                                                                                                                                                        sv_lam[sv_o + 1], ok_sv_o, sv_o), True, Range(1, Length(ss_pair46[2]), 1)) &&
                                                                                                                                                                                                                                                                                          Fold(Function(sv_x + sv_lam[sv_p], sv_x, sv_p), 0, Range(1, Length(sv_lam), 1)) -
                                                                                                                                                                                                                                                                                          Fold(Function(sv_y + ss_pair46[2][sv_q], sv_y, sv_q), 0, Range(1, Length(ss_pair46[2]), 1)) ==
                                                                                                                                                                                                                                                                                          _n, ss_pair46[1]) if Length(ss_pair46) == 2 else False) else False,
       [_x[1], _x[2]],
     ) if Length(_x) == 3 else False

tables(_n)

Apply(
       (_tables: list<integer>) => Join(
                                         _tables,
                                         [] if _n < 1 else Map(
                                                                Function(Apply(
                                                                                (ss_s0: list<list<integer | nan>>) => Apply((ss_lam: list<integer>) => Apply((ss_mu: list<integer>) => Apply((ss_L: integer) => Apply(
                                                                                                                                                                                                                       (ss_len: list<integer>) => Apply(
                                                                                                                                                                                                                                                         (ss_st: list<integer>) => Apply((ss_M: integer) => Fold(
                                                                                                                                                                                                                                                                                                                  Function(ReplaceAt(
                                                                                                                                                                                                                                                                                                                                      ss_f1,
                                                                                                                                                                                                                                                                                                                                      ss_p2 + 1,
                                                                                                                                                                                                                                                                                                                                      Fold(Function(ss_a4 +
                                                                                                                                                                                                                                                                                                                                                    (ss_f1[ss_p2 - ss_st[ss_r3] +
                                                                                                                                                                                                                                                                                                                                                           1] if Apply((ss_d5: integer) => ss_d5 >= 1 &&
                                                                                                                                                                                                                                                                                                                                                                                          (True if ss_r3 == 1 else (ss_p2 -
                                                                                                                                                                                                                                                                                                                                                                                                                    ss_p2 %
                                                                                                                                                                                                                                                                                                                                                                                                                    ss_st[ss_r3 - 1]) /
                                                                                                                                                                                                                                                                                                                                                                                                                   ss_st[ss_r3 - 1] %
                                                                                                                                                                                                                                                                                                                                                                                                                   (ss_len[ss_r3 - 1] +
                                                                                                                                                                                                                                                                                                                                                                                                                    1) <=
                                                                                                                                                                                                                                                                                                                                                                                                                   ss_lam[ss_r3 - 1] -
                                                                                                                                                                                                                                                                                                                                                                                                                   ss_lam[ss_r3] +
                                                                                                                                                                                                                                                                                                                                                                                                                   ss_d5 -
                                                                                                                                                                                                                                                                                                                                                                                                                   1), (ss_p2 -
                                                                                                                                                                                                                                                                                                                                                                                             ss_p2 % ss_st[ss_r3]) /
                                                                                                                                                                                                                                                                                                                                                                                            ss_st[ss_r3] %
                                                                                                                                                                                                                                                                                                                                                                                            (ss_len[ss_r3] + 1)) else 0), ss_a4, ss_r3), 0, Range(1, ss_L, 1)),
                                                                                                                                                                                                                                                                                                                                    ), ss_f1, ss_p2),
                                                                                                                                                                                                                                                                                                                  ReplaceAt(Map(Function(0, ss_z), Range(1, ss_M, 1)), 1, 1),
                                                                                                                                                                                                                                                                                                                  Range(1, ss_M - 1, 1),
                                                                                                                                                                                                                                                                                                                )[ss_M], ss_st[ss_L] *
                                                                                                                                                                                                                                                                                                                        (ss_len[ss_L] + 1)),
                                                                                                                                                                                                                                                         Fold(Function(Join(ss_s7, [ss_s7[ss_i6 - 1] *
                                                                                                                                                                                                                                                                                    (ss_len[ss_i6 - 1] +
                                                                                                                                                                                                                                                                                     1)]), ss_s7, ss_i6), [1], Range(2, ss_L, 1)),
                                                                                                                                                                                                                                                       ),
                                                                                                                                                                                                                       Map(Function(ss_lam[ss_i8] -
                                                                                                                                                                                                                                    (ss_mu[ss_i8] if ss_i8 <= Length(ss_mu) else 0), ss_i8), Range(1, ss_L, 1)),
                                                                                                                                                                                                                     ), Length(ss_lam)), ss_s0[2]), ss_s0[1]),
                                                                                Apply((ss_ix: integer) => [[], []] if _n < 1 else Apply(
                                                                                                                                         (sp_p1: list<integer>) => Apply(
                                                                                                                                                                          (sp_bs: list<integer>) => Apply((sp_rows: integer) => Apply(
                                                                                                                                                                                                                                       (sp_h: list<integer>) => Apply(
                                                                                                                                                                                                                                                                       (sp_p2: list<integer>) => Apply((sp_as: list<integer>) => [
                                                                                                                                                                                                                                                                                                                                   Take(sp_bs, sp_rows),
                                                                                                                                                                                                                                                                                                                                   Take(
                                                                                                                                                                                                                                                                                                                                         Map(Function(sp_as[sp_i] - 1, sp_i), Range(1, sp_rows, 1)),
                                                                                                                                                                                                                                                                                                                                         Fold(Function(sp_n +
                                                                                                                                                                                                                                                                                                                                                       (1 if sp_as[sp_i] > 1 else 0), sp_n, sp_i), 0, Range(1, sp_rows, 1)),
                                                                                                                                                                                                                                                                                                                                       ),
                                                                                                                                                                                                                                                                                                                                 ], Drop(sp_p2, 3)),
                                                                                                                                                                                                                                                                       Fold(
                                                                                                                                                                                                                                                                             Function(sp_q if sp_t > sp_rows else Apply((sp_b: integer) => Apply(
                                                                                                                                                                                                                                                                                                                                                  (sp_fd: list<integer>) => Join([sp_fd[1], sp_q[2] +
                                                                                                                                                                                                                                                                                                                                                                                            sp_b - sp_fd[2] +
                                                                                                                                                                                                                                                                                                                                                                                            1, sp_fd[2]], ReplaceAt(Drop(sp_q, 3), sp_t, sp_fd[2])),
                                                                                                                                                                                                                                                                                                                                                  Fold(Function(sp_f if sp_f[2] > 0 else Apply(
                                                                                                                                                                                                                                                                                                                                                                                                (sp_size: integer) => [sp_f[1], sp_o] if sp_f[1] < sp_size else [sp_f[1] - sp_size, 0],
                                                                                                                                                                                                                                                                                                                                                                                                0 if _n - sp_q[2] -
                                                                                                                                                                                                                                                                                                                                                                                                     (sp_b - sp_o +
                                                                                                                                                                                                                                                                                                                                                                                                      1) <
                                                                                                                                                                                                                                                                                                                                                                                                     0 else sp_h[(sp_rows - sp_t) *
                                                                                                                                                                                                                                                                                                                                                                                                                (_n + 1) *
                                                                                                                                                                                                                                                                                                                                                                                                                (_n + 1) +
                                                                                                                                                                                                                                                                                                                                                                                                                sp_o *
                                                                                                                                                                                                                                                                                                                                                                                                                (_n + 1) +
                                                                                                                                                                                                                                                                                                                                                                                                                (_n - sp_q[2] -
                                                                                                                                                                                                                                                                                                                                                                                                                 (sp_b - sp_o +
                                                                                                                                                                                                                                                                                                                                                                                                                  1)) +
                                                                                                                                                                                                                                                                                                                                                                                                                1],
                                                                                                                                                                                                                                                                                                                                                                                              ), sp_f, sp_o), [sp_q[1], 0], Range(1, Min(sp_b, sp_q[3]), 1)),
                                                                                                                                                                                                                                                                                                                                                ), sp_bs[sp_t]), sp_q, sp_t),
                                                                                                                                                                                                                                                                             Join([sp_p1[1], 0, _n], Map(Function(0, sp_z), Range(1, _n, 1))),
                                                                                                                                                                                                                                                                             Range(1, _n, 1),
                                                                                                                                                                                                                                                                           ),
                                                                                                                                                                                                                                                                     ),
                                                                                                                                                                                                                                       Fold(Function(Join(
                                                                                                                                                                                                                                                           sp_h,
                                                                                                                                                                                                                                                           ReplaceAt(Map(Function(0, sp_z), Range(1, (_n + 1) *
                                                                                                                                                                                                                                                                                                     (_n + 1), 1)), _n + 1 +
                                                                                                                                                                                                                                                                                                            1, 1) if sp_j == 0 else Apply((sp_below: integer) => Apply(
                                                                                                                                                                                                                                                                                                                                                                       (sp_prev: list<integer>) => Map(Function(Apply(
                                                                                                                                                                                                                                                                                                                                                                                                                       (sp_a: integer) => Apply((sp_c: integer) => Fold(Function(sp_s +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 (sp_prev[sp_a2 *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          (_n + 1) +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          (sp_c -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           (sp_below - sp_a2 +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            1)) +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1] if sp_c >=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               sp_below - sp_a2 +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               1 else 0), sp_s, sp_a2), 0, Range(1, Min(sp_below, sp_a), 1)) if sp_a >= 1 &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         sp_a <=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         sp_below + 1 else 0, sp_i %
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  (_n + 1)),
                                                                                                                                                                                                                                                                                                                                                                                                                       (sp_i -
                                                                                                                                                                                                                                                                                                                                                                                                                        sp_i %
                                                                                                                                                                                                                                                                                                                                                                                                                        (_n + 1)) /
                                                                                                                                                                                                                                                                                                                                                                                                                       (_n + 1),
                                                                                                                                                                                                                                                                                                                                                                                                                     ), sp_i), Range(0, (_n + 1) *
                                                                                                                                                                                                                                                                                                                                                                                                                                       (_n + 1) -
                                                                                                                                                                                                                                                                                                                                                                                                                                       1, 1)),
                                                                                                                                                                                                                                                                                                                                                                       Drop(sp_h, (sp_j - 1) *
                                                                                                                                                                                                                                                                                                                                                                                  (_n + 1) *
                                                                                                                                                                                                                                                                                                                                                                                  (_n + 1)),
                                                                                                                                                                                                                                                                                                                                                                     ), sp_bs[sp_rows - sp_j +
                                                                                                                                                                                                                                                                                                                                                                             1]),
                                                                                                                                                                                                                                                         ), sp_h, sp_j), [], Range(0, sp_rows - 1, 1)),
                                                                                                                                                                                                                                     ), Fold(Function(sr_a +
                                                                                                                                                                                                                                                     (1 if sp_bs[sr_i] > 0 else 0), sr_a, sr_i), 0, Range(1, _n, 1))),
                                                                                                                                                                          Drop(sp_p1, 2 +
                                                                                                                                                                                      (_n + 1) *
                                                                                                                                                                                      (_n + 1)),
                                                                                                                                                                        ),
                                                                                                                                         Fold(
                                                                                                                                               Function(sp_st if sp_st[2] == 0 else Apply(
                                                                                                                                                                                           (sp_g: list<integer>) => Apply((sp_bs: list<integer>) => Apply(
                                                                                                                                                                                                                                                           (sp_end: integer) => Join([sp_st[1], 0], sp_g, sp_bs) if sp_st[1] < sp_end else Apply(
                                                                                                                                                                                                                                                                                                                                                  (sp_fd: list<integer>) => Join(
                                                                                                                                                                                                                                                                                                                                                                                  [sp_fd[1], sp_fd[2]],
                                                                                                                                                                                                                                                                                                                                                                                  Map(
                                                                                                                                                                                                                                                                                                                                                                                       Function(Apply((sp_a1: integer) => Apply(
                                                                                                                                                                                                                                                                                                                                                                                                                                 (sp_c1: integer) => Apply((sp_k: integer) => Fold(Function(sp_s +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            sp_g[sp_a *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 (_n + 1) +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 (sp_c1 - sp_k) +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 1], sp_s, sp_a), 0, Range(0 if sp_t == 1 else sp_a1, 0 if sp_t == 1 else Min(sp_fd[2] + 1, _n), 1)) if sp_c1 >= sp_k else 0, sp_fd[2] - sp_a1 +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       1) if sp_a1 >= 1 &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            sp_a1 <= sp_fd[2] else 0,
                                                                                                                                                                                                                                                                                                                                                                                                                                 sp_i %
                                                                                                                                                                                                                                                                                                                                                                                                                                 (_n + 1),
                                                                                                                                                                                                                                                                                                                                                                                                                               ), (sp_i -
                                                                                                                                                                                                                                                                                                                                                                                                                                  sp_i %
                                                                                                                                                                                                                                                                                                                                                                                                                                  (_n + 1)) /
                                                                                                                                                                                                                                                                                                                                                                                                                                 (_n + 1)), sp_i),
                                                                                                                                                                                                                                                                                                                                                                                       Range(0, (_n + 1) *
                                                                                                                                                                                                                                                                                                                                                                                                (_n + 1) -
                                                                                                                                                                                                                                                                                                                                                                                                1, 1),
                                                                                                                                                                                                                                                                                                                                                                                     ),
                                                                                                                                                                                                                                                                                                                                                                                  ReplaceAt(sp_bs, sp_t, sp_fd[2]),
                                                                                                                                                                                                                                                                                                                                                                                ),
                                                                                                                                                                                                                                                                                                                                                  Fold(Function(sp_f if sp_f[2] > 0 else Apply(
                                                                                                                                                                                                                                                                                                                                                                                                (sp_size: integer) => [sp_f[1], sp_o] if sp_f[1] < sp_size else [sp_f[1] - sp_size, 0],
                                                                                                                                                                                                                                                                                                                                                                                                Fold(Function(sp_w +
                                                                                                                                                                                                                                                                                                                                                                                                              Apply((sp_k: integer) => Fold(Function(sp_u +
                                                                                                                                                                                                                                                                                                                                                                                                                                                     Fold(Function(sp_v +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   sp_g[sp_a *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        (_n + 1) + sp_c + 1] *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   _tables[(_n - sp_c -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            sp_k) * _n * _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                           (sp_b - 1) *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                           _n +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                           sp_o], sp_v, sp_c), 0, Range(0, _n - sp_k, 1)), sp_u, sp_a), 0, Range(0 if sp_t == 1 else sp_b, 0 if sp_t == 1 else Min(sp_o + 1, _n), 1)), sp_o - sp_b +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   1), sp_w, sp_b), 0, Range(1, sp_o, 1)),
                                                                                                                                                                                                                                                                                                                                                                                              ), sp_f, sp_o), [sp_st[1] - sp_end, 0], Range(1, sp_st[2], 1)),
                                                                                                                                                                                                                                                                                                                                                ),
                                                                                                                                                                                                                                                           sp_g[(0 if sp_t == 1 else 1) *
                                                                                                                                                                                                                                                                (_n + 1) + _n + 1],
                                                                                                                                                                                                                                                         ), Drop(sp_st, 2 +
                                                                                                                                                                                                                                                                       (_n + 1) *
                                                                                                                                                                                                                                                                       (_n + 1))),
                                                                                                                                                                                           Take(Drop(sp_st, 2), (_n + 1) *
                                                                                                                                                                                                                (_n + 1)),
                                                                                                                                                                                         ), sp_st, sp_t),
                                                                                                                                               Join(
                                                                                                                                                     [ss_ix, _n],
                                                                                                                                                     ReplaceAt(Map(
                                                                                                                                                                    Function(0, sp_z),
                                                                                                                                                                    Range(1, (_n + 1) *
                                                                                                                                                                             (_n + 1), 1),
                                                                                                                                                                  ), 1, 1),
                                                                                                                                                     Map(Function(0, sp_z), Range(1, _n, 1)),
                                                                                                                                                   ),
                                                                                                                                               Range(1, _n, 1),
                                                                                                                                             ),
                                                                                                                                       ), ss_s),
                                                                              ), ss_s),
                                                                Range(
                                                                       0,
                                                                       ((1 if _n ==
                                                                              0 else 0) if _n < 1 else Fold(
                                                                                                            Function(sc_a +
                                                                                                                     Fold(Function(sc_b +
                                                                                                                                   _tables[(_n -
                                                                                                                                            (sc_hi - sc_lo +
                                                                                                                                             1)) * _n * _n +
                                                                                                                                           (sc_lo - 1) *
                                                                                                                                           _n +
                                                                                                                                           sc_hi], sc_b, sc_lo), 0, Range(1, sc_hi, 1)), sc_a, sc_hi),
                                                                                                            0,
                                                                                                            Range(1, _n, 1),
                                                                                                          )) -
                                                                       1,
                                                                       1,
                                                                     ),
                                                              ),
                                       ),
       Fold(Function(Join(
                           sk_t,
                           Fold(
                                 Function(ReplaceAt(
                                                     sk_row,
                                                     sk_c + 1,
                                                     Apply((sk_a: integer) => Apply(
                                                                                     (sk_b: integer) => 0 if sk_a > sk_b else Fold(
                                                                                                                                    Function(sk_x +
                                                                                                                                             Fold(
                                                                                                                                                   Function(sk_y +
                                                                                                                                                            sk_t[(sk_s - sk_b2 -
                                                                                                                                                                  (1 - sk_a2)) *
                                                                                                                                                                 Max(_n, 0) *
                                                                                                                                                                 Max(_n, 0) +
                                                                                                                                                                 (sk_a2 - 1) *
                                                                                                                                                                 _n +
                                                                                                                                                                 (sk_b2 - 1) +
                                                                                                                                                                 1], sk_y, sk_a2),
                                                                                                                                                   0,
                                                                                                                                                   Range(Max(1, sk_b2 - sk_s +
                                                                                                                                                                1), Min(sk_a, sk_b2), 1),
                                                                                                                                                 ), sk_x, sk_b2),
                                                                                                                                    0,
                                                                                                                                    Range(Max(sk_a - 1, 1), sk_b, 1),
                                                                                                                                  ),
                                                                                     sk_c % _n +
                                                                                     1,
                                                                                   ), (sk_c -
                                                                                      sk_c % _n) /
                                                                                     _n +
                                                                                     1),
                                                   ), sk_row, sk_c),
                                 Map(Function(0, sk_z), Range(0, Max(_n, 0) *
                                                                 Max(_n, 0) - 1, 1)),
                                 Range(0, Max(_n, 0) * Max(_n, 0) - 1, 1),
                               ),
                         ), sk_t, sk_s), Fold(
                                              Function(
                                                        ReplaceAt(
                                                                   sk_row,
                                                                   sk_c + 1,
                                                                   1 if sk_c <
                                                                        _n else 0,
                                                                 ),
                                                        sk_row,
                                                        sk_c,
                                                      ),
                                              Map(
                                                   Function(0, sk_z),
                                                   Range(0, Max(_n, 0) *
                                                            Max(_n, 0) - 1, 1),
                                                 ),
                                              Range(0, Max(_n, 0) * Max(_n, 0) -
                                                       1, 1),
                                            ), Range(1, Max(_n, 0) + 1 - 1, 1)),
     )

Enumeration

Examples

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

Count(SkewStandardTableaux(3))=24Count(SkewStandardTableaux(3)) = 24: standard fillings of every skew shape of 3 cells

live ↗
InCount(SkewStandardTableaux(3))\mathrm{Count}(\mathrm{SkewStandardTableaux}(3))Out2424
About
Examples2

See also: SkewPartitions, Count, At