2
$\begingroup$

How many five digit numbers are divisible by three and also contain $6$ as one of its digit?

My attempt
We have to find out four digit "word"( a four digit number that can start with 0 ) divisible by three. If word start with 0 we put 6 on the left of it , and if word start with non zero digit then we can place 6 in $(4-1)+2 = 5 $ places.
But with this method there is a case explosion. Is there a short clever method?

  • 1
    Dumb question. Are you counting numbers like $66,000$?2017-02-01
  • 0
    A quick [python code](http://ideone.com/ERbmG8) I wrote computes `13651` cases. This just checks each number $x$ manually to see if $x\mod 3 = 0$, and if the string `"6"` is in the string `"x"`.2017-02-01
  • 0
    How about counting all 5 digit multiples of three and then subtracting the same count without the digit 6?2017-02-01
  • 0
    The leftmost digit of the 5 is necesarily non-zero?2017-02-01
  • 0
    @Mark Checking in Excel I have $12504$, requiring the number to be $\ge 10000$2017-02-01
  • 0
    @Joffan Why require that the number be $\geq 10000$? Regardless, I've redone my computation for $x\in [10^4,10^5)$ and get something that agrees with you.2017-02-01
  • 0
    @Mark the number $7$ is a one digit number, not a five digit number.2017-02-01

1 Answers 1

2

Let $s$ be the number of $5$-digit numbers that are multiples of $3$.

Let $m$ be the number of $5$-digit numbers that are multiples of $3$ and don't contain $6$.

Finding $s$ is easy, it is $90000/3=30000$

Finding $m$ is also easy, there are exactly three multiples of $3$ that don't contain $6$ for every possible "start" (because each residue appears three times among the digits different from $6$) . So if $ \overline{abcd}$ is a four digit number there are $3$ digits $x$ so that $\overline{abcdx}$ is a multiple of $3$ not containing $6$. so $m=(8\times9\times9\times9)\times 3=17496$

Hence the answer is $30000-17496=12504$

  • 0
    Remarkable, I was just typing up something along these lines.2017-02-01
  • 0
    thank you very much! Time to get some beauty sleep now.2017-02-01
  • 0
    @JorgeFernándezHidalgo Thanks for solution. But I could not follow the part where you have counted m. Can you please re explain it in bit more lucid language?2017-02-01
  • 0
    Its simple, every starting combination of four digits gives you exactly three multiples of three. Foro example, for 1111 the multiples are 11112 11115 11118. So the answer is $3$ multiplied by the number of starting combinations of four digits that dont contain $6$.2017-02-01