Hey.
I want to tell you about one task that has been taking me for a very long time. Just want to say that I do not know its solution (so as not to turn the topic into another topic of evil). Also, I did not meet any tasks like this on the Internet, although I fully admit that the first comment will be with reference to the decision.
So, the task.
')
Suppose we have a safe with a digital lock. To open the safe, you need to dial on the numeric keypad code consisting of
n digits (numbers can be repeated). The safe will open as soon as the code is dialed - the previous incorrect numbers are not taken into account. That is, if the code is “1234”, the safe will open even if you dial “51234”, “781234” or “11234”. The task is to find such a sequence of digits, which with 100% probability will open the safe and which will be minimal in length.