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.
Znajdujesz tajny skarbiec Leonarda da Vinci, zabezpieczony szeregiem zamków szyfrowych. Na szczęście twoja mapa skarbów ma trzy kody. 1210, 3211000 i... hmm. Wydaje się, że brakuje ostatniego. Wygląda na to, że musisz to rozgryźć samodzielnie.
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.
Dwie pierwsze liczby coś łączy. To tak zwane liczby autobiograficzne. Jest to specjalny rodzaj liczby, której struktura sama się opisuje. Każda z cyfr liczby autobiograficznej wskazuje, ile razy cyfra odpowiadająca tej pozycji występuje w liczbie. Pierwsza cyfra oznacza ilość zer, druga cyfra oznacza liczbę jedynek, trzecia cyfra to liczba dwójek i tak dalej aż do końca.
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
Ostatni zamek ma 10-cyfrową liczbę, i tak się składa, że istnieje dokładnie jedna 10-cyfrowa liczba autobiograficzna. Jaka? [Zatrzymaj i rozwiąż samodzielnie] [Odpowiedź za: 3] [Odpowiedź za: 2] [Odpowiedź za: 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.
Próbowanie różnych kombinacji na ślepo zajęłoby wieczność. Przeanalizujmy więc liczby autobiograficzne, które już mamy, żeby znaleźć jakiś wzorzec. Dodając wszystkie cyfry w 1210, otrzymujemy 4, czyli całkowitą liczbę cyfr. To ma sens, bo każda pojedyncza cyfra mówi nam, ile razy jakaś cyfra występuje. A więc cyfry w naszej 10-cyfrowej liczbie autobiograficznej powinny dać sumę 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.
To mówi nam kolejną ważną rzecz. Numer nie może mieć zbyt wielu dużych cyfr. Na przykład, jeśli byłaby tam 6 albo 7, wtedy jakaś cyfra musiałaby pojawić się sześć razy, a inna cyfra siedem razy. To więcej niż 10 cyfr. To oznacza, że w całej sekwencji może być tylko jedna cyfra większa od 5. Tak więc z czterech cyfr: 6, 7, 8 i 9 w kodzie pojawi się najwyżej jedna, a na pozycjach nieobecnych w liczbie cyfr będą stały zera. Wiemy już, że nasza liczba ma co najmniej trzy zera, co oznacza, że pierwsza cyfra licząca zera jest równa 3 albo więcej.
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.
Pierwsza cyfra pokazuje liczbę zer, a każda następna cyfra zlicza, ile razy występuje dana cyfra dodatnia. Jeśli dodamy do siebie wszystkie cyfry z wyjątkiem pierwszej, bo pamiętamy, że zera nie zwiększają sumy, to otrzymamy ilość cyfr dodatnich występujących w liczbie, w tym pierwszą cyfrę. Na przykład, jeśli spróbujemy tego z pierwszym kodem, otrzymamy 2 plus 1, co równa się trzem cyfrom. Jeśli odejmiemy 1, zobaczymy, ile cyfr niezerowych znajduje się po pierwszej cyfrze. W naszym przykładzie są dwie.
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.
Po co to wszystko? To daje nam ważną informację. Ilość cyfr niezerowych występujących po pierwszej cyfrze jest równa sumie tych cyfr minus jeden. A jak rozłożyć liczby, jeśli suma jest większa o 1 od dodanych do siebie niezerowych liczb dodatnich? Jedyna możliwość to jedna dwójka i jedynki. Ile jedynek? Okazuje się, że mogą być tylko dwie. Inaczej w poszukiwanej liczbie musiałyby się znaleźć inne cyfry jak 3 czy 4.
So now we have the leading digit of 3 or greater counting the zeroes, 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.
Wiemy, że pierwsza cyfra określająca ilość zer to co najmniej 3. Cyfra 2 określa ilość jedynek. Są też dwie jedynki. Jedna liczy ilość dwójek, druga liczy pierwszą cyfrę. Skoro już przy tym jesteśmy, sprawdźmy, jaka jest pierwsza cyfra. Ponieważ wiemy, że dwójka i dwie jedynki dają sumę 4, możemy odjąć 4 od 10, w wyniku czego uzyskamy 6. Teraz to tylko kwestia umieszczenia ich na swoich miejscach. Sześć zer, dwie jedynki, jedna dwójka, zero trójek, zero czwórek, zero piątek, jedna szóstka, zero siódemek, zero ósemek i zero dziewiątek.
The safe swings open, and inside you find... Da Vinci’s long-lost autobiography.
Sejf się otwiera, a wewnątrz znajdujesz... dawno zaginioną autobiografię da Vinci.