TOPICS
Search

Discrete Logarithm


The discrete logarithm of an integer a relatively prime to n, with respect to a primitive root g modulo n, is the unique integer mu among 0, 1, 2, ..., phi(n)-1 satisfying

 a=g^mu (mod n).

Here phi(n) is the totient function. The notation is

 mu=ind_ga (mod n).

The term "discrete logarithm" is most commonly used in cryptography, although the term "generalized multiplicative order" is sometimes used as well (Schneier 1996, p. 501). In number theory, the term "index" is generally used instead (Gauss 1801; Nagell 1951, p. 112).

For example, the number 7 is a positive primitive root of n=41 (in fact, the set of primitive roots of 41 is given by 6, 7, 11, 12, 13, 15, 17, 19, 22, 24, 26, 28, 29, 30, 34, 35), and since 15=7^3 (mod 41), the number 15 has multiplicative order 3 with respect to base 7 (modulo 41) (Nagell 1951, p. 112). The generalized multiplicative order is implemented in the Wolfram Language as MultiplicativeOrder[g, n, {a1}], or more generally as MultiplicativeOrder[g, n, {a1, a2, ...}].

Discrete logarithms were mentioned by Charlie the math genius in the Season 2 episode "In Plain Sight" of the television crime drama NUMB3RS.

Polynomial approximation to discrete logarithms is limited even for affine functions. Kopparty et al. (2026) proved that, for a fixed generator g of F_p^* with p prime, an affine polynomial agrees with log_gx on at most O(p^(2/5)) inputs. Here the discrete logarithm is represented by an integer from 0 to p-2 and compared with the polynomial value in F_p.


See also

Multiplicative Order, Primitive Root

Explore with Wolfram|Alpha

References

Gauss, C. F. §57 in Disquisitiones Arithmeticae. Leipzig, Germany, 1801. Reprinted New Haven, CT: Yale University Press, 1965.Kopparty, S.; Kothary, R.; and Shankar, A. "Bounds on Polynomial Approximations of the Discrete Logarithm Function." 24 Oct 2026. https://arxiv.org/abs/2610.33452.Nagell, T. "Exponent of an Integer Modulo n" and "The Index Calculus." §31 and 33 in Introduction to Number Theory. New York: Wiley, pp. 102-106 and 111-115, 1951.Schneier, B Applied Cryptography: Protocols, Algorithms, and Source Code in C, 2nd ed. New York: Wiley, 1996.

Referenced on Wolfram|Alpha

Discrete Logarithm

Cite this as:

Weisstein, Eric W. "Discrete Logarithm." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/DiscreteLogarithm.html

Subject classifications