What is the minimum number of digits required to make the numbers $1-20$?

Any $n$ consecutive numbers can be counted as a $n$-digit consecutive number. So, $$12\\34$$ has the numbers $$1, 2, 3, 4, 12, 13, 21, 24, 31, 34, 42, 43$$ but not the numbers $$123, 14$$ because the digits $1, 2, 3$ are not in a straight line, and $1, 4$ are not consecutive. They have to be touching vertically or horizontally.

Note: your answer should be in a grid form, like above, but the answer doesn't have to be in a complete rectangle, so like $$\space\space23\\45\space\space\\678$$ would still be a valid (although incorrect) answer.


Changed the question from $1-100$ to $1-20$ because it's going to take forever to find the $1-100$ question :)


1 Answer 1


It looks to me as if this is one optimal solution:

0 2 9 3 1 1 5 7 1 8 4 6

Why I think it's an optimal solution:

First of all, it's easy to check that it's a solution. Now, since one 1 is next to at most 4 other digits we need to have at least three of them. And we need one of every other digit; so at least 3+9=12 digits. Above, we have exactly 12 digits.

  • 2
    $\begingroup$ Never fast enough :( $\endgroup$
    – Quintec
    Feb 10, 2018 at 22:00
  • $\begingroup$ Mmmm yes :) I just realized how easy 1-20 was after I tried to actually solve it myslef, but I realized it was too late to change it...just too fast @GarethMcCaughan $\endgroup$
    – NL628
    Feb 11, 2018 at 1:10
  • $\begingroup$ I like the logic behind your answer. simple, yet eloquent $\endgroup$
    – Jason V
    Feb 13, 2018 at 13:48
  • $\begingroup$ @NL628 is this the correct answer or not? $\endgroup$
    – Albino
    Feb 13, 2018 at 22:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.