## 916238457

Posted by Chris on September 24, 2014 – 12:33 pm

916238457 is a nine-digit number that has the property that has the digits 1 to 9 exactly once and the digits 1 to 5 are in counting order but the digits 1 to 6 are not. How many such numbers are there?

September 27th, 2014 at 12:49 am

Assume that you mean that digits 6 to 9 (not 1 to 6) are not in counting order.

My answer: 9!/4! = 15,120

September 27th, 2014 at 1:15 am

Okay, that’s wrong.

September 27th, 2014 at 10:02 am

Hi Wiz. No typos in the posted problem.

I mean e.g. the sequences 612345 and 123645 has 12345 in order, but the 6 isn’t. 789 can be anywhere and in any order.

I don’t know the answer. I haven’t tried to do it yet. Thankfully there can only be 9! = 362 880 possible numbers, so we can easily check by number crunching.

5 mins later: I think I have the answer. If so, then your 9!/4! is a factor.

September 27th, 2014 at 12:04 pm

Aaargh. I had a brain fart. I don’t have the answer.

September 27th, 2014 at 1:15 pm

That was a brain fart too. I do have the answer (perhaps, maybe ).

September 28th, 2014 at 1:50 am

Hi Chris,

Your “clarification” in post 3 seems to confirm what I thought the problem was supposed to state. That is, within the set of nine different digits, 1, 2, 3, 4 and 5 occur in that order but spaced out in any way, and 6, 7, 8 and 9 can occur in any order and placed wherever there are spaces between 1 to 5 within the 9-digit set. But your statement that digits 1 to 6 are NOT (in counting order) makes no sense to me in this context.

So, based on my interpretation of the problem, my answer in post 1 should have been 9!/5! not 9!/4!. That is, the 6 can go in any one of 9 positions, the 7 in any of 8, the 8 in any of 7 and the 9 in any of 6. Then digits 1 to 5, being in counting order, can only go one way into the five remaining spaces.

So, 9!/5! = 3024

September 28th, 2014 at 6:58 am

Hi Wiz. What I meant was that 6 cannot be after the 5 i.e. 123456 is not allowed. NB I’m not indicating the gaps between the digits. It looks like we’re both suffering from brain farts.

My only worry is that the problem seems too easy considering the source.

Later: Your latest answer is closer than the previous one (to what I believe) the right answer is.

September 29th, 2014 at 1:22 am

Okay, so the 7, 8 and 9 can be fitted 9!/6! ways in the set, i.e. 504 ways with 1 to 6 fitting into the gaps. In each case the 6 can go into 5 positions (i.e. before the 1, 2, 3, 4 and 5).

So my latest guess is (9!/6!)*5 = 504*5 = 2520

September 29th, 2014 at 6:17 am

Hi Wiz. That’s the one I get. Your brain works a little differently from mine though. Staring with 12345, there are 5 positions for the 6. Then 7*8*9 = 9!/6! for the 7,8,9.

That was a BMO first round question. It seems far too easy. I probably wouldn’t have posted it if I’d known.

October 2nd, 2014 at 4:50 pm

Hi Chris, Have you tested your answer via computer routine? I might be wrong, but I’d rather go with 9!/5! – 9!/6! = 5*9!/6!

October 3rd, 2014 at 12:58 am

Hi Slavy. I made a boo boo and didn’t combine the two parts. I did mean 5*9!/6!. Thank you.

But I have to ask how come you got the answer via 9!/5! – 9!/6!

October 4th, 2014 at 3:00 am

You have 9! permutations for the digits. If you fix the order of 5 of them (1,2,3,4,5) you have to factor by 5! – the permutations you lose because of that. Now from them you have to subtract the permutations with fixed order of the digits from 1 to 6. As above, this number is 9!/6!

October 7th, 2014 at 12:35 pm

Hi Slavy. Thanks. I get the first bit. The last bit makes my brain hurt.