Let X be a four-digit number with exactly three consecutive digits being the…

2024

Let X be a four-digit number with exactly three consecutive digits being the same, and X is a multiple of 9. How many such numbers X are possible?

  1. A.

    37

  2. B.

    26

  3. C.

    34

  4. D.

    20

Attempted by 11 students.

Show answer & explanation

Correct answer: D

Concept: A whole number is divisible by 9 exactly when the sum of its digits is divisible by 9. In a 4-digit number, having “exactly three consecutive digits the same” forces one of two digit patterns: AAAB (the first three digits identical) or BAAA (the last three digits identical), where A is the repeated digit and B is the differing digit with B ≠ A — if B equalled A, all four digits would be identical, which is excluded by “exactly three”.

Application: In both patterns the digit sum is 3A + B, so for a given repeated digit A, the differing digit B must satisfy 3A + B ≡ 0 (mod 9).

  1. Pattern AAAB: A is the leading digit, so A ranges over 1–9 (a 4-digit number cannot start with 0), and B (the last digit) ranges over 0–9 with B ≠ A.

  2. For each A, solve B ≡ −3A (mod 9) within 0–9. Since 0 and 9 are both valid values whenever the required residue is 0, this gives two candidate values of B when 3A ≡ 0 (mod 9) — i.e. A = 3, 6, 9 — and exactly one candidate value otherwise.

  3. Drop any candidate where B = A (only relevant at A = 9, since 9999 has all four digits identical, not exactly three).

  4. Counting each A from 1 to 9 this way gives 11 valid numbers of pattern AAAB (shown in the table below).

  5. Pattern BAAA: A (the repeated digit) now occupies positions 2–4, so A ranges over 0–9, and B (the leading digit) ranges over 1–9 with B ≠ A.

  6. For each A, solve B ≡ −3A (mod 9) within 1–9. Because 0 is not an allowed leading digit, each A gives exactly one candidate B, except that the candidate must again be dropped if it equals A (only relevant at A = 9).

  7. Counting each A from 0 to 9 this way gives 9 valid numbers of pattern BAAA.

Pattern AAAB — valid trailing digit B for each leading digit A:

A (repeated, leading)

Valid B (last digit)

Count

1, 2, 4, 5, 7, 8

one value each

6

3, 6

two values each (0 and 9)

4

9

one value (0; the candidate 9 is dropped since B ≠ A)

1

Pattern BAAA — valid leading digit B for each repeated digit A:

A (repeated, last three)

Valid B (leading digit)

Count

0–8

one value each

9

9

none (the only candidate is B = 9, dropped since B ≠ A)

0

Cross-check: the two patterns cannot overlap — a number satisfying both would need all four digits equal, which is excluded. A sample check: 3330 (A = 3, B = 0) has digit sum 9, is a multiple of 9, and has exactly three consecutive 3s — valid. Similarly 9000 (B = 9, A = 0) has digit sum 9 and exactly three consecutive 0s — valid. And 9999 is correctly excluded since it has four identical digits, not exactly three.

Result: 11 (pattern AAAB) + 9 (pattern BAAA) = 20 such numbers X.

Explore the full course: Tcs Live Preparation