Skip to content

DistinctPartitions ​

A name from the enumeratio catalogue with no kernel of its own yet; this page carries its crosswalk only.

Catalogued in the enumeratio database, with crosswalk rows in mathlib4, oeis, sage, wolfram; not yet written up here.

✓ checked against that system · ! checked, with disagreements (hover a chip)OEISA000009✓A034320✓A280664✓A092833✓A347587✓A117409✓Wolfram LanguagePartitionsQSageMathPartitions(n, max_slope=-1)mathlib4Nat.Partition.distincts
DistinctPartitions(...)Catalogued in the enumeratio database, with crosswalk rows in mathlib4, oeis, sage, wolfram; not yet written up here.
Typed signatures
TypePackageApplies
(integer<0..>) -> indexed_collection<integer_partition>combinatoricsalways

Domain: Combinatorics

Definition

Epsil, as the implementation runs it.

count(_n)

_tables[_n * (_n + 1) + _n + 1]

unrank(_n, _r)

Drop(
      Fold(
            Function(
                      Apply((pw_m: integer) => Apply((pw_c: integer) => Apply((pw_r: integer) => pw_u if pw_m == 0 else Apply(
                                                                                                                               (pw_chosen: list<integer>) => Join(
                                                                                                                                                                   [pw_m - pw_chosen[2], pw_chosen[2] - 1, pw_chosen[1]],
                                                                                                                                                                   Drop(pw_u, 3),
                                                                                                                                                                   [pw_chosen[2]],
                                                                                                                                                                 ),
                                                                                                                               Fold(
                                                                                                                                     Function(pw_pick if pw_pick[2] != 0 else Apply(
                                                                                                                                                                                     (pw_k: integer) => [pw_pick[1], pw_p] if pw_pick[1] < pw_k else [pw_pick[1] - pw_k, 0],
                                                                                                                                                                                     _tables[(pw_m - pw_p) *
                                                                                                                                                                                             (_n + 1) +
                                                                                                                                                                                             (pw_p - 1) +
                                                                                                                                                                                             1],
                                                                                                                                                                                   ) if True else pw_pick, pw_pick, pw_p),
                                                                                                                                     [pw_r, 0],
                                                                                                                                     Range(Min(pw_m, pw_c), 1, -1),
                                                                                                                                   ),
                                                                                                                             ), pw_u[3]), pw_u[2]), pw_u[1]),
                      pw_u,
                      pw_i,
                    ),
            [_n, _n, _r],
            Range(1, _n, 1),
          ),
      3,
    )

rank(_n, _x)

Fold(Function(Apply((pw_r: integer) => Apply(
                                              (pw_m: integer) => Apply((pw_c: integer) => [pw_r +
                                                                                           Fold(
                                                                                                 Function(pw_s +
                                                                                                          (_tables[(pw_m - pw_q) *
                                                                                                                   (_n + 1) +
                                                                                                                   (pw_q - 1) +
                                                                                                                   1] if True else 0), pw_s, pw_q),
                                                                                                 0,
                                                                                                 Range(
                                                                                                        pw_x + 1,
                                                                                                        Min(pw_m, pw_c),
                                                                                                        1,
                                                                                                      ),
                                                                                               ), pw_m - pw_x, pw_x - 1], pw_a[3]),
                                              pw_a[2],
                                            ), pw_a[1]), pw_a, pw_x), [0, _n, _n], _x)[1]

valid(_n, _x)

Apply(
       (pw_end: list<integer>) => pw_end[1] == 1 && pw_end[2] == 0 && 1 != 0,
       Fold(Function(
                      Apply((pw_f: integer) => Apply((pw_m: integer) => Apply(
                                                                               (pw_c: integer) => [1, pw_m - pw_y, pw_y - 1] if pw_f == 1 &&
                                                                                                                                pw_y >= 1 &&
                                                                                                                                pw_y <=
                                                                                                                                Min(pw_m, pw_c) &&
                                                                                                                                True else [0, 0, 0],
                                                                               pw_v[3],
                                                                             ), pw_v[2]), pw_v[1]),
                      pw_v,
                      pw_y,
                    ), [1, _n, _n], _x),
     )

tables(_n)

Fold(
      Function(Join(
                     pw_t,
                     Fold(
                           Function(
                                     ReplaceAt(
                                                pw_row,
                                                pw_c + 1,
                                                Fold(
                                                      Function(pw_a +
                                                               (pw_t[(pw_s -
                                                                      pw_p) * (_n +
                                                                           1) +
                                                                     (pw_p - 1) +
                                                                     1] if True else 0), pw_a, pw_p),
                                                      0,
                                                      Range(
                                                             1,
                                                             Min(pw_s, pw_c),
                                                             1,
                                                           ),
                                                    ),
                                              ),
                                     pw_row,
                                     pw_c,
                                   ),
                           Map(Function(0, pw_z), Range(0, _n + 1 - 1, 1)),
                           Range(0, _n + 1 - 1, 1),
                         ),
                   ), pw_t, pw_s),
      Fold(
            Function(ReplaceAt(pw_row, pw_c + 1, 1), pw_row, pw_c),
            Map(Function(0, pw_z), Range(0, _n + 1 - 1, 1)),
            Range(0, _n + 1 - 1, 1),
          ),
      Range(1, _n + 1 - 1, 1),
    )

Statistics

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

Maps

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

From IntegerPartition

  • BinaryWordIntegerPartition → BinaryWordInjectionMp00095The shape's boundary read from the first row down: 1 for a step down, 0 for a step left.
  • BulgarianSolitaireIntegerPartition → IntegerPartitionGraded mapMp00308A move of Bulgarian solitaire: the first column of the Ferrers diagram becomes a new row.
  • GlaisherFranklinIntegerPartition → IntegerPartitionbijectioninverseBijectionGraded mapMp00312The Glaisher-Franklin bijection: even part sizes halved become repeated parts, and repeated odd parts merge into their binary multiples.
  • InitialTableauIntegerPartition → StandardTableauInjectionGraded mapMp00042The standard tableau of the shape filled row by row with 1, 2, ..., n.
  • InverseGlaisherFranklinIntegerPartition → IntegerPartitionbijectioninverseBijectionGraded mapMp00313The inverse of GlaisherFranklin: repeated parts merge into doubled parts, and a leftover part splits into copies of its odd part.
  • MinimalDyckPathIntegerPartition → DyckPathInjectionMp00043The shortest Dyck path tracing the shape of the Ferrers diagram.
  • OddPartsWordIntegerPartition → BinaryWordSurjectionMp00317The binary word marking which parts are odd, the parts taken largest first.
  • ParallelogramPolyominoDyckPathIntegerPartition → DyckPathInjectionMp00230The Dyck path of the partition read as a parallelogram polyomino, one column per part.
  • ReadingTableauIntegerPartition → StandardTableauInjectionGraded mapMp00045The recording tableau of the row reading word of the shape filled row by row.
  • RemoveFirstPartIntegerPartition → IntegerPartitionSurjectionMp00202The partition without its largest part: its first row removed.
  • TransposePartitionIntegerPartition → IntegerPartitioninvolutionBijectionGraded mapInvolutionMp00044The conjugate partition: column i of the Ferrers diagram becomes row i.

To IntegerPartition

  • BlockSizePartitionSetPartition → IntegerPartitionsurjectionSurjectionGraded mapMp00079The partition of n a set partition's block sizes form, largest first.
  • ConjugateAfterCycleTypePermutation → IntegerPartitionThe conjugate partition of the cycle type.
  • CutOutPartitionDyckPath → IntegerPartitionInjectionMp00027The partition cut out of the staircase by the path: part i is the number of downs before the (n + 1 - i)-th up step.
  • CycleTypePermutation → IntegerPartitionsurjectionSurjectionGraded mapMp00108The multiset of cycle lengths, as a partition.
  • NegativeCycleTypeSignedPermutation → IntegerPartitionSurjectionMp00169The lengths of the negative cycles, largest first: those of the underlying permutation with an odd number of negative entries.
  • PositiveCycleTypeSignedPermutation → IntegerPartitionSurjectionMp00166The lengths of the positive cycles, largest first: those of the underlying permutation with an even number of negative entries.
  • RskShapePermutation → IntegerPartitionsurjectionSurjectionGraded mapMp00060The common shape of the RSK tableaux: the row lengths, as a partition of n.
  • SortedPartitionIntegerComposition → IntegerPartitionsurjectionSurjectionGraded mapMp00040The partition a composition's parts form, sorted largest first.
  • TableauShapeStandardTableau → IntegerPartitionsurjectionSurjectionGraded mapMp00083The shape of a standard tableau: its row lengths.
21 more in FindStat, not implemented here
  • Mp00021CorePartition → IntegerPartitionGraded mapBijectionto bounded partition
  • Mp00022CorePartition → IntegerPartitionSurjectionto partition
  • Mp00037LabeledGraph → IntegerPartitionSurjectionGraded mapto partition of connected components
  • Mp00077SemistandardTableau → IntegerPartitionSurjectionGraded mapshape
  • Mp00110Posets → IntegerPartitionSurjectionGraded mapGreene-Kleitman invariant
  • Mp00179IntegerPartition → SkewPartitionInjectionGraded mapto skew partition
  • Mp00182SkewPartition → IntegerPartitionSurjectionouter shape
  • Mp00183SkewPartition → IntegerPartitionSurjectioninner shape
  • Mp00186SkewPartition → IntegerPartitionSurjectionGraded mapdominating partition
  • Mp00204Permutation → IntegerPartitionSurjectionGraded mapLLPS
  • Mp00225SemistandardTableau → IntegerPartitionSurjectionweight
  • Mp00251LabeledGraph → IntegerPartitionclique sizes
  • Mp00275LabeledGraph → IntegerPartitionSurjectionto edge-partition of connected components
  • Mp00276LabeledGraph → IntegerPartitionto edge-partition of biconnected components
  • Mp00306Posets → IntegerPartitionrowmotion cycle type
  • Mp00307Posets → IntegerPartitionpromotion cycle type
  • Mp00311PlanePartition → IntegerPartitionGraded mapto partition
  • Mp00321IntegerPartition → IntegerPartitionBijectionGraded mapInvolution2-conjugate
  • Mp00322IntegerPartition → IntegerPartitionBijectionGraded mapLoehr-Warrington
  • Mp00323IntegerPartition → IntegerPartitionBijectionGraded mapLoehr-Warrington inverse
  • Mp00332Posets → IntegerPartitionSurjectionGraded mapJordan block partition

Enumeration

Examples

Basic #

6 = 6 = 5+1 = 4+2 = 3+2+1: four partitions into distinct parts

live ↗
InCount(DistinctPartitions(6))\mathrm{Count}(\mathrm{DistinctPartitions}(6))Out44

The first three, in enumeration order

live ↗
InTake(DistinctPartitions(6),3)\mathrm{Take}(\mathrm{DistinctPartitions}(6), 3)Out[IntegerPartition⁡([6]),IntegerPartition⁡([5,1]),IntegerPartition⁡([4,2])]\bigl\lbrack{\operatorname{IntegerPartition}}([6]), {\operatorname{IntegerPartition}}([5, 1]), {\operatorname{IntegerPartition}}([4, 2])\bigr\rbrack
Properties #

Ten partitions of 10 into distinct parts (A000009)

live ↗
InCount(DistinctPartitions(10))\mathrm{Count}(\mathrm{DistinctPartitions}(10))Out1010
About
Examples3
Checked againstmathlib4 3 agree
CrosswalkOEIS ×6Wolfram LanguageSageMathmathlib4

Implementation

mappedmathlib4packages/oracle/src/mappings.ts

Nat.Partition.distincts, enumerated and ordered as IntegerPartitions