# how to solve this counting problem?

Each user on a computer system has a password, which is six to eight characters long, where each character is an uppercase letter or a digit. Each password must contain at least two digits. How many possible passwords are there?

Is the answer: $(36^6 - 26^5) + (36^7 - 26^6) + (36^8 - 26^7)$?

• This site uses MathJax formatting of formulas. More tips here. (from a bot) – user147263 Nov 19 '15 at 6:26
• Note that the legal passwords of length $l$ are all possible passwords of length $l$ less the sum of those with exactly zero digits and those with exactly one digit. – copper.hat Nov 19 '15 at 6:43

I would use $$\left(36^6 - 26^6 - \binom{6}{1}\cdot 26^5\cdot 10 \right) + \left(36^7 - 26^7 - \binom{7}{1}\cdot 26^6\cdot 10 \right) + \left(36^8 - 26^8 - \binom{8}{1}\cdot 26^7\cdot 10 \right).$$