Copyright © University of Cambridge. All rights reserved.

'Mini-max' printed from https://nrich.maths.org/

Show menu


Thomas, James, Jonathan Liong, Scott Reynolds, Ren Papilion, and Tom Stevens from St Peters College, Adelaide, Australia all discovered that writing down the $90$ two digit numbers ($10,11,\ldots ,99$) uses nine $0$'s, and nineteen of each of the digits $1,2,\ldots ,9$. To check this we see that $9+(19\times 9) = 180$, which gives the correct number of digits altogether.

Ling Xiang Ning, Tao Nan School, Singapore and Sheila Luk, Joyce Fu and Sam Webster, Year 10, The Mount School, York all spotted the rule for the number of occurrences of each digit in writing down all $n$ digit numbers.

Elizabeth Hyde, age 13 from Haybridge High School, Hagley West Midlands went on to derive this general formula using a spreadsheet and M. Ali Khan, age 18, Reigate College also gave a clear logically argued solution.

Solution for three digit numbers: For three digits there are $900$ numbers ($1,2,\ldots ,999$ excluding $1,2,\ldots ,99$) and hence $2700$ digits.

Consider the occurrences of the digit $1$. There is only one number in which this digit occurs three times, that is the number $111$.

Now consider numbers in which $1$ occurs exactly twice. There are eight of these of the form $x11$ (where $x$ is some other digit and $x \neq 0, 1$ and nine of the form $1x1$ (where $x\neq 1$), and nine of the form $11x$ (where $x\neq 1$). This makes a total of $52$ occurrences of the digit $1$ for these numbers.

Finally, consider the numbers in which $1$ occurs exactly once. There are $81$ of these of the form $1xy$ (where $x$ and $y$ are other digits and $x,y\neq 1$), $72$ of the form $x1y$ (where $x\neq 0,1$ and $y\neq 1$), and $72$ of the form $xy1$ (where $x\neq 0,1$ and $y\neq 1$). This makes a total of $180$ occurrences of the digit $1$ for these numbers, and hence a grand total of $280$ occurrences of the digit $1$.

Now the same argument holds with $1$ replaced by any of the other digits $2,3,\ldots ,9$ so the number of occurrences of $0$ is $2700-(8\times 280)=180$. We can check this directly in two different ways. First, we can count the number of occurrences of $0$ in numbers of the forms $xy0$, $x0y$ and $x00$. Second, we would expect there to be $100$ fewer $0$'s than any other digit because none of the numbers can start with $0$.

Solution for four digit numbers: There are $9000$ four digit numbers containing $36000$ digits. The digits $1,\ldots ,9$ each occur $A$ times, and $0$ occurs $A-1000$ times. Thus $$(A - 1000)+ 9A = 36000,$$ so that $A = 3700$.

Solution for the general case: For $n$ digit numbers (from $10^{n-1}$ to $10^n-1$ inclusive) there are $(10^n-1)-(10^{n-1}-1) = 9\times 10^{n-1}$ numbers and hence $9n\times 10^{n-1}$ digits. As before, $1,2,\ldots ,9$ occur $A$ times each and $0$ occurs $A - 10^{n-1}$ times. Thus $$(A - 10^{n-1}) + 9A = 9n\times 10^{n-1}.$$ and hence $A = (9n+1)\times 10^{n-2}$. Checking, with $n=3$ we have $A = 28\times 10$, and with $n=4$, $A = 37\times 10^2$.