Problem about Leonardo da Vinci's cache, which is not so easy to get into
Recreation / / December 31, 2020
If you randomly select combinations of numbers, it will take a long time to solve. It is better to analyze the numbers we have and identify the pattern.
Summing up the digits of the first number - 1210, we get 4 (the number of digits in this combination). Summing up the digits of the second number - 3211000, we get 7 (the result is also equal to the number of digits in this combination). Each digit indicates how many times it appears in the given number. Therefore, the sum of the digits in a 10-digit autobiographical number must be 10.
It follows from this that there cannot be many large numbers in the third combination. For example, if 6 and 7 were present there, this would mean that some number should be repeated six times, and some seven, as a result of which there would be more than 10 digits.
Thus, throughout sequences there can be no more than one digit more than 5. That is, out of four digits - 6, 7, 8 and 9 - only one can be part of the desired combination. Or none at all. The unused digits will be replaced by zeros. It turns out that the desired number contains at least three zeros and that in the first place there is a digit that is greater than or equal to 3.
The first digit in the desired sequence determines the number of zeros, and each further digit determines the number of nonzero digits. If you add up all the digits except the first, you get a number that determines the number of non-zero digits in the desired combination, taking into account the very first digit in the sequence.
For example, if we add the numbers in the first combination, we get 2 + 1 = 3. Now we subtract 1 and get a number that determines the number of non-zero digits after the first, leading digit. In our case, this is 2.
These calculations provide important information that the number of nonzero digits after the first digit is the sum of those digits minus 1. How do I calculate the values of digits whose sum is 1 more than the number of nonzero positive integers to add?
The only possible option is when one of the terms is two, and the others are ones. How many units? It turns out that there can be only two of them - otherwise, the numbers 3 and 4 would be present in the sequence.
Now we know that the first digit must be 3 or higher - it determines the number of zeros; then the number 2 to determine the number of ones and two 1s, one of which indicates the number of twos, the other - to the first digit.
Now let's determine the value of the first digit in the desired sequence. Since we know that the sum of 2 and two 1s is 4, subtract that value from 10 to get 6. Now all that remains is to arrange all the numbers in the correct sequence: six 0, two 1, one 2, zero 3, zero 4, zero 5, one 6, zero 7, zero 8 and zero 9. The required number is 6210001000.
The hiding place opens and the tourist discovers a long-lost autobiography inside. Leonardo da Vinci. Hurrah!
The puzzle is based on a TED-Ed video.