Modular Exponentiation 5^21mod23
Enter Modular Exponentiation
Solve 521 mod 23 using:
Modular exponentiation
Build an algorithm:
n is our exponent = 21
y = 1 and u ≡ 5 mod 23 = 5
See here
n = 21 is odd
Since 21 is odd, calculate (y)(u) mod p
(y)(u) mod p = (1)(5) mod 23
(y)(u) mod p = 5 mod 23
5 mod 23 = 5
Reset y to this value
Determine u2 mod p
u2 mod p = 52 mod 23
u2 mod p = 25 mod 23
25 mod 23 = 2
Reset u to this value
Cut n in half and take the integer
21 ÷ 2 = 10
n = 10 is even
Since 10 is even, we keep y = 5
Determine u2 mod p
u2 mod p = 22 mod 23
u2 mod p = 4 mod 23
4 mod 23 = 4
Reset u to this value
Cut n in half and take the integer
10 ÷ 2 = 5
n = 5 is odd
Since 5 is odd, calculate (y)(u) mod p
(y)(u) mod p = (5)(4) mod 23
(y)(u) mod p = 20 mod 23
20 mod 23 = 20
Reset y to this value
Determine u2 mod p
u2 mod p = 42 mod 23
u2 mod p = 16 mod 23
16 mod 23 = 16
Reset u to this value
Cut n in half and take the integer
5 ÷ 2 = 2
n = 2 is even
Since 2 is even, we keep y = 20
Determine u2 mod p
u2 mod p = 162 mod 23
u2 mod p = 256 mod 23
256 mod 23 = 3
Reset u to this value
Cut n in half and take the integer
2 ÷ 2 = 1
n = 1 is odd
Since 1 is odd, calculate (y)(u) mod p
(y)(u) mod p = (20)(3) mod 23
(y)(u) mod p = 60 mod 23
60 mod 23 = 14
Reset y to this value
Determine u2 mod p
u2 mod p = 32 mod 23
u2 mod p = 9 mod 23
9 mod 23 = 9
Reset u to this value
Cut n in half and take the integer
1 ÷ 2 = 0
Because n = 0, we stop
We have our answer
Final Answer
521 mod 23 ≡ 14
You have 1 free calculations remaining
What is the Answer?
521 mod 23 ≡ 14
How does the Modular Exponentiation and Successive Squaring Calculator work?
Free Modular Exponentiation and Successive Squaring Calculator - Solves xn mod p using the following methods:
* Modular Exponentiation
* Successive Squaring
This calculator has 1 input.
What 1 formula is used for the Modular Exponentiation and Successive Squaring Calculator?
Successive Squaring I = number of digits in binary form of n. Run this many loops of a2 mod pFor more math formulas, check out our Formula Dossier
What 6 concepts are covered in the Modular Exponentiation and Successive Squaring Calculator?
- exponent
- The power to raise a number
- integer
- a whole number; a number that is not a fraction
...,-5,-4,-3,-2,-1,0,1,2,3,4,5,... - modular exponentiation
- the remainder when an integer b (the base) is raised to the power e (the exponent), and divided by a positive integer m (the modulus)
- modulus
- the remainder of a division, after one number is divided by another.
a mod b - remainder
- The portion of a division operation leftover after dividing two integers
- successive squaring
- an algorithm to compute in a finite field