By signing in you confirm you are 18 or older, or have your parent’s or guardian’s consent.

UPSC Prelims 2019 CSAT, question 9

Topic: Number system

Q9

The number of times the digit 5 will appear while writing the integers from 1 to 1000 is

  1. (a) 269
  2. (b) 271
  3. (c) 300Correct answer
  4. (d) 302

Solution.

Answer: (c) 300

  1. Writing the integers from 11 to 999999 as three-digit strings 001001 to 999999 (since 10001000 contains no 55, and 000000 contains no 55), there are 10001000 strings of 33 digits each from 000000 to 999999.
  2. By symmetry, the digit 55 appears in the units place 100100 times, in the tens place 100100 times, and in the hundreds place 100100 times, giving a total of 100+100+100=300100 + 100 + 100 = 300 occurrences.

Trap: Do not count the numbers containing at least one digit 5 (103−93=27110^3 - 9^3 = 271); the question asks for the total number of times the digit 5 is written (300300).