GATE / CS ARCHIVE

SIMILAR QUESTIONS / DISCRETE MATHEMATICS

Reduce large powers using modular cycles

2 questions solved the same way, newest first. Back to Discrete Mathematics

1 mark · NAT
Report issue

Reducing a large power modulo five

Proof Techniques & Number Theory

Question 21, GATE 2019: Compute 3^51 modulo 5. The exponent in the original is 51.
Tap to enlarge
Answer & solution

Official answer: 2

Method: find the repeating cycle of powers modulo 5, rather than form the large integer.

1. Compute successive residues: 3¹≡3, 3²=9≡4, 3³≡4×3=12≡2, and 3⁴≡2×3=6≡1 (mod 5).
2. Once the residue is 1, the next powers repeat this four-step pattern. Write 51=4×12+3.
3. Therefore 351=(3⁴)12·3³≡112·2≡2 (mod 5).
4. The residue 2 already lies in the standard range 0 through 4, so no further reduction is needed.

Result: 2.

Original paper, page 8 · Answer key

2 marks · NAT
Report issue

Proof Techniques & Number Theory

Question 29, GATE 2016: Find 13^99 modulo 17, expressed from 0 through 16.
Tap to enlarge
Answer & solution

Official answer: 4.0 : 4.0

Our answer: 4

13²=169≡−1 modulo 17, so 13⁴≡1. Since99≡3 modulo 4, 1399≡13³≡−13≡4 modulo 17.

The powers cycle as 13,16,4,1 modulo 17. Write 99=4×24+3, then replace 134×24 by 1 and retain the third power. Working modulo after every multiplication avoids enormous integers. The intermediate −13 is a valid congruence but must be reported as 4 in the specified nonnegative range.

Original paper, page 33 · Answer key