Root Of Unity Modulo N
   HOME

TheInfoList



OR:

In mathematics, namely
ring theory In algebra, ring theory is the study of rings—algebraic structures in which addition and multiplication are defined and have similar properties to those operations defined for the integers. Ring theory studies the structure of rings, their r ...
, a ''k''th root of unity modulo ''n'' for positive
integer An integer is the number zero (), a positive natural number (, , , etc.) or a negative integer with a minus sign ( −1, −2, −3, etc.). The negative numbers are the additive inverses of the corresponding positive numbers. In the languag ...
s ''k'', ''n'' ≥ 2, is a
root of unity In mathematics, a root of unity, occasionally called a de Moivre number, is any complex number that yields 1 when raised to some positive integer power . Roots of unity are used in many branches of mathematics, and are especially important ...
in the ring of integers modulo ''n'', that is, a solution ''x'' to the equation (or ''congruence'') x^k \equiv 1 \pmod . If ''k'' is the smallest such exponent for ''x'', then ''x'' is called a primitive ''k''th root of unity modulo ''n''. See
modular arithmetic In mathematics, modular arithmetic is a system of arithmetic for integers, where numbers "wrap around" when reaching a certain value, called the modulus. The modern approach to modular arithmetic was developed by Carl Friedrich Gauss in his boo ...
for notation and terminology. Software to compute modular roots is available in the python library sympy.ntheory.residue_ntheory using the function nthroot_mod. See https://docs.sympy.org/latest/modules/ntheory.html. Do not confuse this with a primitive root modulo ''n'', which is a generator of the group of
units Unit may refer to: Arts and entertainment * UNIT, a fictional military organization in the science fiction television series ''Doctor Who'' * Unit of action, a discrete piece of action (or beat) in a theatrical presentation Music * Unit (album), ...
of the ring of integers modulo ''n''. The primitive roots modulo ''n'' are the primitive \varphi(n)-roots of unity modulo ''n'', where \varphi is Euler's totient function. This topic deals with roots of unity modulo ''n'' where ''n'' is at times not a prime number. addresses the special case where ''n'' is prime and
Root of unity In mathematics, a root of unity, occasionally called a de Moivre number, is any complex number that yields 1 when raised to some positive integer power . Roots of unity are used in many branches of mathematics, and are especially important ...
covers (non-modular) roots of unity in the field of complex numbers.


Roots of unity


Properties

* If ''x'' is a ''k''th root of unity modulo ''n'', then ''x'' is a unit (invertible) whose inverse is x^. That is, ''x'' and ''n'' are
coprime In mathematics, two integers and are coprime, relatively prime or mutually prime if the only positive integer that is a divisor of both of them is 1. Consequently, any prime number that divides does not divide , and vice versa. This is equivale ...
. * If ''x'' is a unit, then it is a (primitive) ''k''th root of unity modulo ''n'', where ''k'' is the
multiplicative order In number theory, given a positive integer ''n'' and an integer ''a'' coprime to ''n'', the multiplicative order of ''a'' modulo ''n'' is the smallest positive integer ''k'' such that a^k\ \equiv\ 1 \pmod n. In other words, the multiplicative order ...
of ''x'' modulo ''n''. * If ''x'' is a ''k''th root of unity and x-1 is not a
zero divisor In abstract algebra, an element of a ring is called a left zero divisor if there exists a nonzero in such that , or equivalently if the map from to that sends to is not injective. Similarly, an element of a ring is called a right zer ...
, then \sum_^ x^j \equiv 0 \pmod, because :: (x-1)\cdot\sum_^ x^j \equiv x^k-1 \equiv 0 \pmod.


Number of ''k''th roots

For the lack of a widely accepted symbol, we denote the number of ''k''th roots of unity modulo ''n'' by f(n,k). It satisfies a number of properties: * f(n,1) = 1 for n\ge2 * f(n,\lambda(n)) = \varphi(n) where λ denotes the
Carmichael function In number theory, a branch of mathematics, the Carmichael function of a positive integer is the smallest positive integer such that :a^m \equiv 1 \pmod holds for every integer coprime to . In algebraic terms, is the exponent of the multip ...
and \varphi denotes Euler's totient function * n \mapsto f(n,k) is a
multiplicative function In number theory, a multiplicative function is an arithmetic function ''f''(''n'') of a positive integer ''n'' with the property that ''f''(1) = 1 and f(ab) = f(a)f(b) whenever ''a'' and ''b'' are coprime. An arithmetic function ''f''(''n'') i ...
* k\mid l \implies f(n,k)\mid f(n,l) where the bar denotes
divisibility In mathematics, a divisor of an integer n, also called a factor of n, is an integer m that may be multiplied by some integer to produce n. In this case, one also says that n is a multiple of m. An integer n is divisible or evenly divisible by ...
* f(n,\mathrm(a,b)) = \mathrm(f(n,a),f(n,b)) where \mathrm denotes the
least common multiple In arithmetic and number theory, the least common multiple, lowest common multiple, or smallest common multiple of two integers ''a'' and ''b'', usually denoted by lcm(''a'', ''b''), is the smallest positive integer that is divisible by bo ...
* For
prime A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only ways ...
p, \forall i\in\mathbb\ \exists j\in\mathbb\ f(n,p^i) = p^j. The precise mapping from i to j is not known. If it were known, then together with the previous law it would yield a way to evaluate f quickly.


Examples

Let n = 7 and k = 3 . In this case, there are three cube roots of unity (1, 2, and 4). When n = 11 however, there is only one cube root of unity, the unit 1 itself. This behavior is quite different from the field of complex numbers where every nonzero number has ''k'' ''k''th roots.


Primitive roots of unity


Properties

* The maximum possible radix exponent for primitive roots modulo n is \lambda(n), where λ denotes the
Carmichael function In number theory, a branch of mathematics, the Carmichael function of a positive integer is the smallest positive integer such that :a^m \equiv 1 \pmod holds for every integer coprime to . In algebraic terms, is the exponent of the multip ...
. * A radix exponent for a primitive root of unity is a
divisor In mathematics, a divisor of an integer n, also called a factor of n, is an integer m that may be multiplied by some integer to produce n. In this case, one also says that n is a multiple of m. An integer n is divisible or evenly divisible by ...
of \lambda(n). * Every divisor k of \lambda(n) yields a primitive kth root of unity. You can obtain one by choosing a \lambda(n)th primitive root of unity (that must exist by definition of λ), named x and compute the power x^. * If ''x'' is a primitive ''k''th root of unity and also a (not necessarily primitive) ℓth root of unity, then ''k'' is a divisor of ℓ. This is true, because
Bézout's identity In mathematics, Bézout's identity (also called Bézout's lemma), named after Étienne Bézout, is the following theorem: Here the greatest common divisor of and is taken to be . The integers and are called Bézout coefficients for ; they ...
yields an integer linear combination of ''k'' and ℓ equal to \mathrm(k,\ell). Since ''k'' is minimal, it must be k = \mathrm(k,\ell) and \mathrm(k,\ell) is a divisor of ℓ.


Number of primitive ''k''th roots

For the lack of a widely accepted symbol, we denote the number of primitive ''k''th roots of unity modulo ''n'' by g(n,k). It satisfies the following properties: * g(n,k) = \begin >0 &\text k\mid\lambda(n), \\ 0 & \text. \end * Consequently the function k \mapsto g(n,k) has d(\lambda(n)) values different from zero, where d computes the
number of divisors In mathematics, and specifically in number theory, a divisor function is an arithmetic function related to the divisors of an integer. When referred to as ''the'' divisor function, it counts the ''number of divisors of an integer'' (including ...
. * g(n,1) = 1 * g(4,2) = 1 * g(2^n,2) = 3 for n \ge 3, since -1 is always a
square root In mathematics, a square root of a number is a number such that ; in other words, a number whose ''square'' (the result of multiplying the number by itself, or  ⋅ ) is . For example, 4 and −4 are square roots of 16, because . ...
of 1. * g(2^n,2^k) = 2^k for k \in [2,n-1) * g(n,2) = 1 for n \ge 3 and n in * \sum_ g(n,k) = f(n,\lambda(n)) = \varphi(n) with \varphi being Euler's totient function * The connection between f and g can be written in an elegant way using a Dirichlet convolution: :: f = \mathbf * g, i.e. f(n,k) = \sum_ g(n,d) : You can compute values of g recursively from f using this formula, which is equivalent to the [ öbius inversion formula.


Testing whether ''x'' is a primitive ''k''th root of unity modulo ''n''

By fast exponentiation you can check that x^k \equiv 1 \pmod. If this is true, ''x'' is a ''k''th root of unity modulo ''n'' but not necessarily primitive. If it is not a primitive root, then there would be some divisor ℓ of ''k'', with x^ \equiv 1 \pmod. In order to exclude this possibility, one has only to check for a few ℓ's equal ''k'' divided by a prime. That is, what needs to be checked is: :\forall p \text\ k,\quad x^ \not\equiv 1 \pmod.


Finding a primitive ''k''th root of unity modulo ''n''

Among the primitive ''k''th roots of unity, the primitive \lambda(n)th roots are most frequent. It is thus recommended to try some integers for being a primitive \lambda(n)th root, what will succeed quickly. For a primitive \lambda(n)th root ''x'', the number x^ is a primitive kth root of unity. If ''k'' does not divide \lambda(n), then there will be no ''k''th roots of unity, at all.


Finding multiple primitive ''k''th roots modulo ''n''

Once you have a primitive ''k''th root of unity ''x'', every power x^l is a kth root of unity, but not necessarily a primitive one. The power x^l is a primitive kth root of unity if and only if k and l are
coprime In mathematics, two integers and are coprime, relatively prime or mutually prime if the only positive integer that is a divisor of both of them is 1. Consequently, any prime number that divides does not divide , and vice versa. This is equivale ...
. The proof is as follows: If x^l is not primitive, then there exists a divisor m of k with (x^l)^m \equiv 1 \pmod, and since k and l are coprime, there exists an inverse l^ of l modulo k. This yields 1 \equiv ((x^l)^m)^ \equiv x^m \pmod, which means that x is not a primitive kth root of unity because there is the smaller exponent m. That is, by exponentiating ''x'' one can obtain \varphi(k) different primitive ''k''th roots of unity, but these may not be all such roots. However, finding all of them is not so easy.


Finding an ''n'' with a primitive ''k''th root of unity modulo ''n''

You may want to know, in what integer
residue class ring In ring theory, a branch of abstract algebra, a quotient ring, also known as factor ring, difference ring or residue class ring, is a construction quite similar to the quotient group in group theory and to the quotient space in linear algebra. I ...
s you have a primitive ''k''th root of unity. You need it for instance if you want to compute a
Discrete Fourier Transform In mathematics, the discrete Fourier transform (DFT) converts a finite sequence of equally-spaced samples of a function into a same-length sequence of equally-spaced samples of the discrete-time Fourier transform (DTFT), which is a comple ...
(more precisely a
Number theoretic transform In mathematics, the discrete Fourier transform over a ring generalizes the discrete Fourier transform (DFT), of a function whose values are commonly complex numbers, over an arbitrary ring. Definition Let R be any ring, let n\geq 1 be an intege ...
) of a k-dimensional integer
vector Vector most often refers to: *Euclidean vector, a quantity with a magnitude and a direction *Vector (epidemiology), an agent that carries and transmits an infectious pathogen into another living organism Vector may also refer to: Mathematic ...
. In order to perform the inverse transform, you also need to divide by k, that is, ''k'' shall also be a unit modulo n. A simple way to find such an ''n'' is to check for primitive ''k''th roots with respect to the moduli in the
arithmetic progression An arithmetic progression or arithmetic sequence () is a sequence of numbers such that the difference between the consecutive terms is constant. For instance, the sequence 5, 7, 9, 11, 13, 15, . . . is an arithmetic progression with a common differ ...
k+1, 2k+1, 3k+1, \dots. All of these moduli are coprime to ''k'' and thus ''k'' is a unit. According to
Dirichlet's theorem on arithmetic progressions In number theory, Dirichlet's theorem, also called the Dirichlet prime number theorem, states that for any two positive coprime integers ''a'' and ''d'', there are infinitely many primes of the form ''a'' + ''nd'', where ''n'' is als ...
there are infinitely many primes in the progression, and for a prime p it holds \lambda(p) = p-1. Thus if mk+1 is prime then \lambda(mk+1) = mk and thus you have primitive ''k''th roots of unity. But the test for primes is too strong, you may find other appropriate moduli.


Finding an ''n'' with multiple primitive roots of unity modulo ''n''

If you want to have a modulus n such that there are primitive k_1th, k_2th, ..., k_mth roots of unity modulo n, the following theorem reduces the problem to a simpler one: : For given n there are primitive k_1th, ..., k_mth roots of unity modulo n if and only if there is a primitive \mathrm(k_1, ..., k_m)th root of unity modulo ''n''. ; Proof Backward direction: If there is a primitive \mathrm(k_1, ..., k_m)th root of unity modulo n called x, then x^ is a k_lth root of unity modulo n. Forward direction: If there are primitive k_1th, ..., k_mth roots of unity modulo n, then all exponents k_1, \dots, k_m are divisors of \lambda(n). This implies \mathrm(k_1, \dots, k_m) \mid \lambda(n) and this in turn means there is a primitive \mathrm(k_1, ..., k_m)th root of unity modulo n.


References

{{reflist Modular arithmetic