Seven-digit telephone numbers are not allowed to begin with $0$ or $1$.

I can only remember a seven-digit telephone number if the first three digits (the "prefix") are equal to either the next three digits or the last three digits. For example, I can remember $389$-$3892$ and $274$-$9274$.

How many seven-digit telephone numbers can I remember?

I split this up into 2 cases, 1 where the first 3 is the same as the next 3 and another where the first three is the same as the last 3 and I got 8000 for each case and multiplied by 2 which is 16000. However, there are cases where all the digits are the same, like 8888888, but I don't know how many there are and what to subtract from 16000.

  • $\begingroup$ The only cases in which both occur are those when every digit is the same as you have seen. There are only $8$ of these cases so the answer should be $16000-8=15992$. $\endgroup$ Commented Jun 22, 2020 at 15:44

1 Answer 1


First I would check how many "first three digits" there are, which are not allowed to begin with $0$ or $1$. So there are $8 \times 10 \times 10 = 800$ possible "first three digits"

Pick one possibility, call it $ABC$, and split it into cases as you said.

Case "ABC-ABCx": well there are 10 choices for the last digit, totalling $800 \times 10 = 8000$ possibilities

Similarly for case "ABC-xABC". Hence so far we have $$ Case1 + Case2 = 16,000 $$

But as you point out we overcounted, since "ABC-ABCx"="ABC-xABC" exactly when $x=A,x=C$ and $B=A$. Namely phone numbers of the form "AAA-AAAA", of which there are $8$ possibilities. So final answer is $$ Total = 16,000 - 8 $$


You must log in to answer this question.