Skip to content

Commit

Permalink
Merge pull request #4998 from TheGamingMousse/formatting-change
Browse files Browse the repository at this point in the history
Exponentiation II Formatting Change
  • Loading branch information
ryanchou-dev authored Dec 23, 2024
2 parents 95a1fba + 88b3b49 commit ccc19cf
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ author: Ryan Chou

## Explanation

[Fermat's Little Theorem](/gold/modular) tells us that $a^{p - 1} \equiv 1 \pmod{p}$, so we can calculate $a^{b^c \pmod{1e9 + 7 - 1}} \pmod{1e9+7}$ with modular exponentiation.
Let $M = 10^{9} + 7$.

[Fermat's Little Theorem](/gold/modular) tells us that $a^{p - 1} \equiv 1 \pmod{p}$, so we can calculate $a^{b^c \pmod{M - 1}} \pmod{M}$ with modular exponentiation.

## Implementation

Expand Down

0 comments on commit ccc19cf

Please sign in to comment.