On an issue

A question:
for a given a, b seek

aaaa..a(modp)
(Which has a b a).

For this problem, there are two methods to understand.
1. If it is calculated from the bottom up, so it's actually a formula:

aab1

Then we index above formula can be used by Fermat's Little Theorem mod p1 To get a smaller index, and then do a quick power can be.
Complex as O(log2p+log2(p1))
2. If it is calculated from the top downwards, it can be extended by Euler's theorem:
amamin(m,(m mod z ( p ) ) + z ( p ) )(modp)

Recursive index continued until z ( p ) = 1 When, Back 1.
Operators Euler function recursively.

Published 51 original articles · won praise 6 · views 20000 +

Guess you like

Origin blog.csdn.net/qq_35776579/article/details/77823524