Biggest 8 digit number following two specific rules

3.3k Views Asked by At

Which is the biggest 8 digit number of the form "abcdefgh" which is made up only of 1, 2, 3 and 4 and which follows the rule: the digit 1 is one digit away from another 1, the digit 2 is two digits away from another 2, the digit 3 is three digits away from another 3, etc.?

2

There are 2 best solutions below

7
On

Assuming that the conditions are like $1 - 1,2--2, 3---3, 4----4$, I suggest $$41312432$$ Starting from putting the 4's you get something like that $$4----4--$$ then you should maximize the number, so work on the 3's. The first 3 can only be put in the third place to get $$4-3--43-$$ Now the conclusion should be obvious, since a 2 must be put in the last place and the 1 in the second to get $$41312432$$

1
On

I assume by $1$'s are one space apart you mean the $1$'s must be adjacent. The best you can do is start with a $4$, giving $4bcd4fgh$. Now $b$ can't be $3$, so try $2$, giving $42c24fgh$. Clearly $c$ must be $3$ and we get $42324311$