PermutationOrder
The order of p in the symmetric group — the lcm of its cycle lengths.
✓ checked against that system · ! checked, with disagreements (hover a chip)FindStat
St000058via Permutation✓Wolfram LanguagePermutationOrder✓PermutationOrder(p)The order of p in the symmetric group — the lcm of its cycle lengths.SageMath
enumeratio_stat("Permutation", p, "PermutationOrder")Typed signatures
| Type | Package | Applies |
|---|---|---|
(permutation) -> number | combinatorics | always |
Details
- Defined over
Permutationas an expression in_x, evaluated by compute-engine — the definition IS the implementation. - Takes a
Permutationand nothing else — it reads values against their positions, or walks the orbits, so it needs the bijection. Applying it to a bare list is a type error, not a wrong answer. - Wolfram's PermutationOrder. The bare
Orderis Wolfram's canonical-ordering comparisonOrder[a, b], so this head replaces it. The old name is recorded informerlybut does not resolve:Order(p)is now Wolfram'sOrder.
Definition
Epsil, as the implementation runs it.
on Permutation, over _x
1 if Length(_x) < 1 else Fold(
Function(LCM(a, b), a, b),
1,
Map(
Function(Min(Filter(
Range(1, Length(_x), 1),
Function(Fold(
Function(_x[w], w, j),
i,
Range(1, k, 1),
) == i, k),
)), i),
Filter(
Range(1, Length(_x), 1),
Function(
Fold(
Function(
w if w <=
0 else 0 if w == i else -1 if w < i else _x[w],
w,
k,
),
_x[i],
Range(
1,
Length(_x),
1,
),
) == 0,
i,
),
),
),
)Examples
Properties #
About
| Examples | 5 |
|---|---|
| Checked against | Wolfram Language 2 agreeSageMath 5 agreemathlib4 2 agree |
| Crosswalk | FindStatWolfram LanguageSageMath |
Implementation
mapped
sagepackages/oracle/src/mappings.tsmapped
mathlib4packages/oracle/src/mappings.tsA 1-based one-line permutation list, rebuilt as an Equiv.Perm (Fin n) (a list that is not a permutation prints "not a permutation"); the order is the lcm of the cycle type (Equiv.Perm.lcm_cycleType), since orderOf is noncomputable