GATE Computer ScienceHardGATE CS

How many residues r modulo 105 are perfect squares, that is, how many distinct values of x² mod 105 occur for x = 0, 1, …, 104 (r = 0 included)?

  1. A. 12
  2. B. 53
  3. C. 36
  4. D. 24

Correct answer: D. 24

By the Chinese remainder theorem a residue is a square mod 105 iff it is a square mod 3, mod 5 and mod 7. Squares mod 3: 2 values (0, 1); mod 5: 3 values (0, 1, 4); mod 7: 4 values (0, 1, 2, 4). Total 2 × 3 × 4 = 24. Counting only unit residues would give 1 × 2 × 3 = 6, which is the common wrong turn.

More Discrete Mathematics questions

Exams that ask this topic