How many sequences $n$ terms long exist where each term is a number from $0$-$9$, and a specific number, let’s say $x$, is present anywhere in the sequence.

I thought to solve this by taking all the possible sequences, $10^n$, and subtracting from it the sequences where $x$ is not present, meaning $9^n$.

Is this correct?

So for a sequence $2$ terms long, there are $19$ sequences where the number $2$ appears.

  • $\begingroup$ This question is nearly equivalent to asking How many $n$-digit numbers have $x$ in them? That said, your solution seems correct. $\endgroup$ – Naman Kumar Jan 22 at 13:31
  • 2
    $\begingroup$ Your solution is correct. $\endgroup$ – N. F. Taussig Jan 22 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.