[Math] A 10-digit number whose $n$th digit gives the number of $(n-1)$s in it

decimal-expansionelementary-number-theory

There is a ten-digit number $X$ such that its first (left-most) digit is equal to the number of $0$s in $X$, the second digit gives the number of $1$s in $X$, and so on. The last (right-most) digit gives the number of $9$s in $X$. Find $X$.

Aren't there a lot of possibilities for a solution?

Best Answer

It looks like you can solve it recursively.

  1. The first number can't be 0, because then the number of zeros isn't 0
  2. Can it be 9? => 9,000, 000,00? NO
  3. Can it be 8? => 8,?00,000,010 NO- but there is contradiction
  4. Can it be 7? => 7,?00,000,100 NO
  5. Can it be 6? => 6,210,001,000 Yes
  6. Can it be 5? => 5,???,???,???

And you play this way a little bit. I guess the solution is the only one