You’ve found Leonardo Da Vinci’s secret vault, secured by a series of combination locks. Fortunately, your treasure map has three codes: 1210, 3211000, and… hmm. The last one appears to be missing. Looks like you’re gonna have to figure it out on your own.
Você descobriu o esconderijo secreto de Leonardo da Vinci, protegido por uma série de fechaduras com combinações. Felizmente, o seu mapa do tesouro tem três códigos: 1210, 3211000 e... hum. Aparentemente falta o último. Parece que você terá que descobrir por si só.
There’s something those first two numbers have in common: they’re what’s called autobiographical numbers. This is a special type of number whose structure describes itself. Each of an autobiographical number’s digits indicates how many times the digit corresponding to that position occurs within the number. The first digit indicates the quantity of zeroes, the second digit indicates the number of ones, the third digit the number of twos, and so on until the end.
Há duas coisas que os dois primeiros números têm em comum: são o que chamamos de números autobiográficos. É um tipo especial de número cuja estrutura descreve a si mesmo. Cada um dos dígitos do número autobiográfico indica quantas vezes o dígito que corresponde a essa posição ocorre dentro do número. O primeiro dígito indica a quantidade de zeros, o segundo dígito indica o número de uns, o terceiro dígito o número de dois e assim sucessivamente até ao fim.
The last lock takes a 10 digit number, and it just so happens that there’s exactly one ten-digit autobiographical number. What is it? Pause here if you want to figure it out for yourself! Answer in: 3 Answer in: 2 Answer in: 1
A última fechadura tem um número de dez dígitos, e acontece que só há um número autobiográfico com dez dígitos. Qual é ele? [Pause aqui se quiser descobrir sozinho.] [Resposta em: 3] [Resposta em: 2] [Resposta em: 1]
Blindly trying different combinations would take forever. So let’s analyze the autobiographical numbers we already have to see what kinds of patterns we can find. By adding all the digits in 1210 together, we get 4 – the total number of digits. This makes sense since each individual digit tells us the number of times a specific digit occurs within the total. So the digits in our ten-digit autobiographical number must add up to ten.
Tentar diferentes combinações às cegas demoraria uma eternidade. Assim, vamos analisar os números autobiográficos que já temos para ver que tipo de padrões podemos encontrar. Se somarmos todos os dígitos do número 1210 obtemos o 4, o número total de dígitos. Faz sentido porque cada dígito individual nos diz o número de vezes que ocorre um dígito específico no total. Então, os dígitos no nosso número autobiográfico de dez dígitos têm que somar 10.
This tells us another important thing – the number can’t have too many large digits. For example, if it included a 6 and a 7, then some digit would have to appear 6 times, and another digit 7 times– making more than 10 digits. We can conclude that there can be no more than one digit greater than 5 in the entire sequence. So out of the four digits 6, 7, 8, and 9, only one – if any-- will make the cut. And there will be zeroes in the positions corresponding to the numbers that aren’t used. So now we know that our number must contain at least three zeroes – which also means that the leading digit must be 3 or greater.
Isso nos diz outra coisa importante: o número não pode ter dígitos demasiado grandes. Por exemplo, se incluísse um 6 e um 7, um dos dígitos teria que aparecer seis vezes e outro dígito sete vezes, o que resultaria em mais de dez dígitos. Podemos concluir que não pode haver mais do que um dígito maior que cinco em toda a sequência. Então, dos quatro dígitos 6, 7, 8 e 9, só um deles, se algum, pode constar na sequência. E haverá zeros nas posições correspondentes aos números que não forem usados. Agora sabemos que o nosso número tem que conter, pelo menos, três zeros ou seja, o dígito correspondente a zero tem que ser três ou maior.
Now, while this first digit counts the number of zeroes, every digit after it counts how many times a particular non-zero digit occurs. If we add together all the digits besides the first one – and remember, zeroes don’t increase the sum – we get a count of how many non-zero digits appear in the sequence, including that leading digit. For example, if we try this with the first code, we get 2 plus 1 equals 3 digits. Now, if we subtract one, we have a count of how many non-zero digits there are after the first digit – two, in our example.
Enquanto este primeiro dígito conta o número de zeros, todos os dígitos depois dele contam quantas vezes ocorre um dígito diferente de zero. Se somarmos todos os dígitos ao primeiro dígito, e não se esqueçam que os zeros não aumentam a soma, obtemos o total de quantos dígitos diferentes de zero aparecem na sequência, incluindo esse primeiro dígito. Por exemplo, se tentarmos com o primeiro código, obtemos 2 mais 1 igual a 3 dígitos. Se subtrairmos 1, temos um total de quantos dígitos diferentes de zero há depois do primeiro dígito: dois, no nosso exemplo.
Why go through all that? Well, we now know something important: the total quantity of non-zero digits that occur after the first digit is equal to the sum of these digits, minus one. And how can you get a distribution where the sum is exactly 1 greater than the number of non-zero positive integers being added together? The only way is for one of the addends to be a 2, and the rest 1s. How many 1s? Turns out there can only be two – any more would require additional digits like 3 or 4 to count them.
Por que fazer tudo isto? Agora sabemos uma coisa importante: a quantidade total dos dígitos diferentes de zero que ocorrem depois do primeiro dígito é igual à soma desses dígitos menos 1. Como obtemos uma distribuição em que a soma seja exatamente uma unidade maior do que a soma dos números positivos diferentes de zero? A única forma é que um deles seja um 2 e os restantes sejam 1. Quantos 1? Só pode haver dois número 1. Se houvesse mais, seriam necessários dígitos adicionais,
So now we have the leading digit of 3 or greater counting the zeroes,
como 3 ou 4 para contá-los.
a 2 counting the 1s, and two 1s – one to count the 2s and another to count the leading digit. And speaking of that, it’s time to find out what the leading digit is. Since we know that the 2 and the double 1s have a sum of 4, we can subtract that from 10 to get 6. Now it’s just a matter of putting them all in place: 6 zeroes, 2 ones, 1 two, 0 threes, 0 fours, 0 fives, 1 six, 0 sevens, 0 eights, and 0 nines.
Agora temos o primeiro dígito de 3 ou maior, para contar os zeros. Um 2 para contar os 1, e dois 1, um para contar os 2, e outro para adicionar ao primeiro dígito. Por falar nisso, é a hora de descobrir qual é esse primeiro dígito. Como sabemos que o 2 e os dois 1, somam 4, podemos subtrair esse número de 10 e obtemos 6. Agora, basta colocar todos nos seus lugares: seis 0, dois 1, um 2, zero 3, zero 4, zero 5, um 6, zero 7, zero 8 e zero 9.
The safe swings open, and inside you find... Da Vinci’s long-lost autobiography.
O esconderijo se abre e lá dentro você encontra a autobiografia de Da Vinci há muito tempo desaparecida.