Skip to main content
Challenges Fermat's little theorem
Cryptography Easy Fermat's little theorem Solves: 7

Fermat's little theorem

Author: CyberSamSU
Points
20

Fermat's Little Theorem: if p is a prime number and a is not divisible by p, then a^(p-1) ≡ 1 (mod p).

A very useful conclusion follows from this: the exponent can be reduced modulo mod (p-1). That is, a^E mod p = a^(E mod (p-1)) mod p. Therefore, regardless of how many hundreds of digits the exponent has, the calculation is performed instantly.

Calculate a^E mod p for the following very large exponent E.

p = 16831203241
a = 15778967088
E = 2981278545155698078263095560721056813512636752398612608485781422
8845003374394558556316922407023615055679067611460888926396053598
087

Answer: only a number — in decimal format, without spaces and additional characters (for example 1234).

Hints 3
Opening a hint reduces the points you get for solving this challenge.
Hint 1 −2 pts Log in
Hint 2 −4 pts Log in
Hint 3 −6 pts Log in
To submit a flag, log in.

First solvers

1. Лазиз 04.10.2026
2. Mirjaxon Qaxxarov 26.10.2026
3. Odam 06.11.2026
4. Doston Allayarov 12.11.2026
5. Jasmin Xuseinova 15.11.2026
6. Aminova 18.11.2026
7. farang1z_06 20.11.2026