where

Notice the different ground fields on which we are computing here. This is similar to the function, where the exponent arithmetic was done on a different field, but in reverse.

If the signature of the argument is 0, we cannot compute the
discrete logarithm.
This is a case analogous to a division by zero, and we will proceed
as with it.
I.e. we will recursively test whether the argument is 0.
If it is, then the computation does not make sense and it is aborted.
If it is not, then we have found an *n* for which the signature is
non-zero, and we continue the computation in this field.

With such a value for *E*, not being a primitive root, there will
be discrete logarithms that will not be possible to compute.
This problem is tricky to solve, but we can use the fact that
the range of the discrete logarithm is normally 0 ... *m*-2,
and we fold this range to 0 ... *n*-1.
Let *r*=*p*^{n}, then *r* is a *k*^{th} root of unity, and .
Multiplying the arguments of the logarithms by any power of *r*will not change their signature.
If the base of the logarithms is *p*, then it is clear that

In other words, the signatures of logarithms group values of the arguments in equivalence classes of size

A numerical example helps to understands all these computations and
problems.
Assume that *n*=13 and *m*=53 and hence *k*=4.
Let *p*=2 which is a primitive root (mod 53).
Then
and
.
We would like to prove that

The signatures of the arguments are and