Our goal is to determine
. Let us assume we have a prime number p and that
p-1 can be factored in the following way:

then we can say that

Thus if one can find
for all i, one could use the Chinese Remainder Theorem to
combine them and obtain
. In order to do this consider expanding
as follows

Then it is possible to show that

In order to show this, we have to see that

Multiplying out Eq (6) one obtains

Applying
Eq(7) (one can apply
to Eq(7) since it represents the
exponent of Eq(5) which is all done in
)

Therefore Eq(5) becomes

Let
and
. Then

Using Shank's algorithm we find
given
,
,
and p (notice that there are only
possible values for
). Now let
. Then

Considering only the exponents


Then,

and we can use Shank's algorithm to find
given
,
, and p. We
now repeat the same procedure to obtain
as follows.

Doing p-1 modular arithmetic, one finds that

Then if one lets


We then apply Shank's algorithm to find
. This process is
continued to obtain all
coefficients in Eq(4). From these
coefficients, we can find
for all
and finally combine them using the Chinese Remainder Theorem to
obtain
. [4]