PrimitiveRootList
Every primitive root of — every generator of — ascending.
✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram Language
PrimitiveRootList!PrimitiveRootList(n)the generators of the unit group mod , or when it is not cyclicSageMath
enumeratio_primitive_root_list(n)Typed signatures
| Type | Package | Applies |
|---|---|---|
(integer) -> list<integer> | compute-engine | always |
(integer) -> list<integer> | residuesreplaces compute-engine | always |
Details
- is cyclic exactly for with an odd prime; otherwise there are no primitive roots and the list is empty.
- When there is one generator there are : the powers with .
- A candidate is a generator iff for every prime , so has to be factored.
- At most 100 000 roots are listed; past that the call stays unevaluated. PrimitiveRoot gives the least one at any size.
Examples
2 more kept as data, checked against the oraclesPossible issues #
About
| Examples | 17 |
|---|---|
| Checked against | Wolfram Language 14 agree2 differSageMath 12 agree1 differ1 error |
| Crosswalk | Wolfram LanguageSageMath |
Implementation
mapped
wolframpackages/oracle/src/mappings.tsSage's primitive_root gives one root only; run.ts's SAGE_PREAMBLE walks the powers coprime to phi(n).
mapped
sagepackages/oracle/src/mappings.tsSage's primitive_root gives one root only; run.ts's SAGE_PREAMBLE walks the powers coprime to phi(n).
See also: PrimitiveRoot, MultiplicativeOrder, PowerModList