Math Fundamentals18 sections · 814 units
Open in Course

Count Good Numbers - Counting Pattern

Positions alternate

The key insight: positions alternate between even digits and prime digits. Even positions have 5 choices each. Odd positions have 4 choices each.

For nn digits, count how many even positions and how many odd positions you have. If n=5n = 5, positions 0, 2, 4 are even (3 positions), positions 1, 3 are odd (2 positions).

Total good numbers = 5even positions×4odd positions5^{\text{even positions}} \times 4^{\text{odd positions}}. For n=5n = 5, that's 53×42=125×16=20005^3 \times 4^2 = 125 \times 16 = 2000.