You found Leonardo da Vinci’s secret trunk, but to unlock the lock you have to solve a riddle insert 3 numbers: one of 4 digitsone of 7 digits and one of 10 digits. The case seems impossible, but you have a treasure map in which the first two numbers are indicated, 1210 and 3211000, two so -called “autobiographical” numbers: what will the third be? Let’s see the enigma solution and what are the autobiographical numbers.
The riddle of the Leonardo da Vinci’s lock
First of all, we understand what is meant by “autobiographical numbers”. It is numbers that are described by themselves: for example 1210 it is composed exactly by 1 zero figure, 2 One digits, 1 figure two e 0 Three figures, who put nearby they become precisely 1210.

The autobiographical numbers are therefore Numbers such that the first figure says how many 0 make up the number, the second figure how many 1 make up the number, the third as 2 make the number and so on.
The second number of the code also falls within the definition, in fact it is composed of 3 zeri, 2 a, 1 two, 1 Three, 0 four, 0 five, 0 six.

To unlock the lock, all we have to do is find the only autobiographical number of 10 digits existing, what will it be?

The solution to the enigma
A way to resolve the riddle is to build the number sought by looking at its figures as if they were empty boxes to be filled with 1, 2, 3 etc., in which each empty box is represented by a 0. It can be taken step by step starting from a simple number and changing it until we find what we seek:
- The simplest situation is that of the number 0000000000 in which the boxes are all empty. Clearly it is not an autobiographical number because the first figure, which is worth 0, tells us that in this number there should be no zeros, but in reality we have 10.
- We can remedy by putting 9 in the first box getting 9000000000a number in which there are exactly Zeri 9.
- At this point in our number the figure appears 9then his 10th box we have to write 1 To indicate that in the number there is exactly a 9: we get like this 9000000001.

- Here in the number also appeared a 1 And this must be indicated by adding a 1 in the second box, 9100000001only that we have 2 now 1 hour, so in the one box one should write 2 get 9200000001.
- We lost a 1, but since a 2 appeared, We write 1 in the box 2the third, and here the one we had lost reappears: 9210000001.

- We are almost there, but there are 6 zeri and not 9, so in the first box we have to write six: 6210000001.
- To complete the work, take one of the last box and move it to the seventh box in order to indicate that the number contains a 6, and we are in place: 6210001000 It will be our number.

The number found, in fact, contains 6 zeri, 2 a, 1 two, 0 Three, 0 four, 0 five, 1 six, 0 seven, 0 eight e 0 Nine and it is autobiographical: here we can unlock the lock of Leonardo’s secret trunk!
But how many and what are the autobiographical numbers are?
Looking for all autobiographical numbers may seem like a difficult task, but the nature of these numbers is quite binding, and enjoy properties that very close to the field, let’s see the two simpler.
First of all, if we take the first of our numbers, 1210and we add up 1+2+1+0 we get 4That It is precisely the amount of numbers of the number. The same goes for the other two autobiographical numbers that we met: 3211000 is of 7 figures e 3+2+1+0 0++0 = 7While 6210001000 is of 10 figures e 6+2+1+0+0++1+0+0+0 = 10. Essentially In autobiographical numbers the sum of the values of the figures is equal to the amount of numbers of the number.
Another feature of these numbers is that, with the exception of the first figure, The other figures can only be worth 1 or 2in our 3 numbers, in fact, the only largest figure of 2 is the first. So if we have to go looking for all autobiographical numbers we can limit ourselves to those who enjoy these properties, and there are those who did it finding that there are very few, only these seven: 1210, 2020, 21200, 3211000, 42101000, 521001000, 6210001000!
