UPSC CSAT 2023 Q27: Remainder of a Repdigit Divided by 13 — Solved

A number N is formed by writing 9 for 99 times. What is the remainder if N is divided by 13?

  1. 11
  2. 9
  3. 7
  4. 1

Answer: (a) 11

Solution

  1. Write N in a usable form. N = 999…9, with 99 nines. Every number made only of nines is one less than a power of 10. So N = 10^99 − 1. We need the remainder when N is divided by 13.

  2. Find the shortest string of nines that 13 divides exactly. Divide strings of nines by 13 one length at a time: - 9 ÷ 13 → remainder 9 - 99 = 13 × 7 + 8 → remainder 8 - 999 = 13 × 76 + 11 → remainder 11 (13 × 76 = 988, and 999 − 988 = 11) - 9999 = 13 × 769 + 2 → remainder 2 - 99999 = 13 × 7692 + 3 → remainder 3 - 999999 = 13 × 76923 → remainder 0

So 999999, which has six nines, is divisible by 13. The reason: 999999 = 999 × 1001, and 1001 = 7 × 11 × 13.

  1. Split the 99 nines into blocks of six. 99 ÷ 6 = 16, remainder 3. So N is 16 blocks of 999999 followed by 3 more nines: N = 999999 999999 … 999999 (16 blocks) 999.

  2. Remove the blocks that 13 divides. Write N = M × 1000 + 999, where M is the number formed by the 16 blocks of 999999 (96 nines). M is a row of 999999 blocks placed side by side, so M = 999999 × (1 + 10^6 + 10^12 + … + 10^90). That makes M a multiple of 999999, so 13 divides M, and 13 also divides M × 1000.

  3. The remainder comes only from the leftover part. The remainder of N ÷ 13 is the same as the remainder of 999 ÷ 13.

  4. Compute it. 13 × 76 = 988. 999 − 988 = 11.

  5. Check with powers of 10. 10^6 = 999999 + 1, so 10^6 leaves remainder 1 when divided by 13. Then 10^96 = (10^6)^16 also leaves remainder 1, and 10^99 = 10^96 × 1000 leaves the same remainder as 1000. 1000 = 13 × 76 + 12, so that remainder is 12. N = 10^99 − 1 therefore leaves 12 − 1 = 11. This matches step 6.

Answer: the remainder is 11.

Option-wise explanation

  • a: correct — 13 divides 999999, and 99 = 6 × 16 + 3, so every full block of six nines drops out. Only 999 is left, and 999 = 13 × 76 + 11.
  • b: incorrect — 9 is the remainder when the leftover part is a single nine (9 ÷ 13). You get this if you split 99 nines wrongly, for example taking 99 ÷ 6 as leaving 1, or if you just divide the digit 9 by 13. The leftover is 3 nines, not 1.
  • c: incorrect — No leftover of 1 to 5 nines gives 7. Those remainders are 9, 8, 11, 2 and 3. A value of 7 points to an arithmetic slip, such as taking the quotient 7 from 99 = 13 × 7 + 8 as if it were the remainder.
  • d: incorrect — 1 is the remainder of 10^6 (and of 10^96) divided by 13, not the remainder of N. The trap is stopping at 'the cycle repeats' without dealing with the 3 leftover nines, or forgetting the '− 1' in N = 10^99 − 1.

How to eliminate

Remember one fact: 999999 (six nines) is divisible by 7, 11, 13 and 37, because 999999 = 999 × 1001 and 1001 = 7 × 11 × 13. Then 99 ÷ 6 leaves 3, so the answer is just 999 mod 13. 13 × 76 = 988, which leaves 11. You do not need to back-solve from the options. Each option matches the leftover from one particular wrong split: 1 nine gives 9, and 1 is what 10^6 leaves. Once you have the leftover count right, only one option fits. About 30–45 seconds if you know the 1001 fact, and about 90 seconds if you have to find the six-nines cycle by dividing. Attempt it in the first round: it is short and certain.

Know more

Remainders of repdigits (numbers like 111…1 or 999…9)

A string of k nines equals 10^k − 1. If 10^n leaves remainder 1 when divided by a divisor d, then a string of n nines is divisible by d. So the remainders repeat every n digits. To find the remainder for any length, divide the length by n and keep only the leftover digits.

The key identity: 10^6 − 1 = 999999 = 999 × 1001 = 3³ × 37 × 7 × 11 × 13. So six nines (or six ones, 111111) is divisible by 7, 11, 13 and 37.

Divisor Shortest all-9 string it divides Cycle length
3, 9 9 1
11 99 2
37, 27 999 3
7, 13 999999 6

Steps: (1) find the cycle length n; (2) compute k mod n = r; (3) the remainder equals that of the r-digit string divided by the divisor. If r = 0, the remainder is 0.

Worked variant: 1 is written 40 times. What is the remainder when this number is divided by 7? 111111 = 7 × 15873, so the cycle is 6. 40 = 6 × 6 + 4, so only 1111 is left. 7 × 158 = 1106, and 1111 − 1106 = 5. Remainder = 5.

The same method works for any repeating block, such as 123123…123. Find the block multiple the divisor divides, then work with the leftover.