A phone number has seven digits and cannot begin with a 0.
How many phone numbers contain the sequence 123?
First, we need to place "123" in the string of 7 digits. There are 5 ways to do that.
Now, we have to place 8 digits in the first digit, at 0 cannot be one. So far, there are 5 * 8 = 40 ways.
Now, we simply have to place digits in the remaining 3 digits. There are 93 = 729 ways to do that.
Therefore, there are 40 * 729 = 29160 phone numbers :D
The number could look like this: 123abcd ---> 10 x 10 x 10 x 10 = 10000 ways
or like this: a123bcd ---> 9 x 10 x 10 x 10 = 9000 ways
[there are only 9 possibilities for a (because 0 can't be used)]
or like this: ab123cd ---> 9 x 10 x 10 x 10 = 9000 ways
or like this: abc123d ---> 9 x 10 x 10 x 10 = 9000 ways
or like this: abcd123 ---> 9 x 10 x 10 x 10 = 9000 ways
Adding these together, we get 46000 ways.