(49 50) Primitive Roots Modulo n
|
11-28-2024, 12:44 PM
(This post was last modified: 11-28-2024 04:47 PM by John Keith.)
Post: #1
|
|||
|
|||
(49 50) Primitive Roots Modulo n
Two programs regarding primitive roots. The programs require the libraries ListExt and IFACTOR, and Gerald H's ORD (multiplicative order, see also this post).
The first program 'NOPR' returns the number of primitive roots modulo n. Code:
The second program 'LOPR' returns a list of all primitive roots modulo n. If n has no primitive roots, the list will be empty, otherwise the size of the list will be Phi(Phi(n)). Equivalent to the Wolfram language (Mathematica) function PrimitiveRootList. Execution time is roughly proportional to n. Code:
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)