Can anyone explain the relation between modular inverse of p^k and p^(k-1) given M. Any help would be appreciated.
# | User | Rating |
---|---|---|
1 | jiangly | 3977 |
2 | tourist | 3815 |
3 | jqdai0815 | 3682 |
4 | ksun48 | 3614 |
5 | orzdevinwang | 3526 |
6 | ecnerwala | 3514 |
7 | Benq | 3483 |
8 | hos.lyric | 3381 |
9 | gamegame | 3374 |
10 | heuristica | 3358 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | -is-this-fft- | 162 |
3 | Um_nik | 161 |
4 | atcoder_official | 159 |
5 | djm03178 | 157 |
5 | Dominater069 | 157 |
7 | adamant | 154 |
8 | awoo | 152 |
8 | luogu_official | 152 |
10 | TheScrasse | 148 |
Can anyone explain the relation between modular inverse of p^k and p^(k-1) given M. Any help would be appreciated.
Name |
---|
if m is prime we have Fermat's little theorem :
(pk)m−1≡1modm
(pk)m−2≡p−kmodm
(pk−1)m−2pm−2≡p−kmodm
p−k+1pm−2≡p−kmodm
p−k+1p−1≡p−kmodm
if m is not prime see Euler's theorem
also, check modular-inverce cp algorithms
pk−1−1≡p−(k−1)≡p−k+1≡pk−1⋅p