GATE / CS ARCHIVE

GATE CSE 2019 / QUESTION 21

Reducing a large power modulo five

Discrete Mathematics · Proof Techniques & Number Theory · Full GATE CSE 2019 paper

GATE 2019, Q21 1 mark · NAT
Report issue

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