primitiveroot
primitiveroot is a term used in abstract algebra, specifically in the study of modular arithmetic and finite fields. In the context of modular arithmetic, a primitiveroot modulo n is an integer g such that every integer coprime to n is congruent to a power of g modulo n. In other words, g is a primitiveroot modulo n if its order modulo n is equal to phi(n), where phi is Euler's totient function. This means that the powers of g, g^1, g^2, g^3, ..., g^(phi(n)) will produce all the integers from 1 to n-1 that are coprime to n, in some order, when considered modulo n.
Not all integers n have primitiveroots. Primitive roots exist only for integers n of the form 2,
The concept of primitiveroots is important in various fields, including cryptography, where they are used in