The discrete logarithm of an integer relatively prime to
, with respect to a primitive
root
modulo
,
is the unique integer
among 0, 1, 2, ...,
satisfying
Here
is the totient function. The notation is
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
(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
, 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 of
with
prime, an affine polynomial agrees
with
on at most
inputs. Here the discrete logarithm is represented by an integer
from 0 to
and compared with the polynomial value in
.