We say that a positive integer N is nice if it satisfies the following conditions: $\bullet$ All of its digits are $1$ or $2$ $\bullet$ All numbers formed by $3$ consecutive digits of $N$ are distinct. For example, $121222$ is nice, because the $4$ numbers formed by $3$ consecutive digits of $121222$, which are $121,212,122$ and $222$, are distinct. However, $12121$ is not nice. What is the largest quantity possible number of numbers that a nice number can have? What is the greatest nice number there is?
Problem
Source: 1st Girls in Mathematics Tournament 2019 p3 (Brazil) / Torneio Meninas na Matematica (TM^2 )
Tags: number theory, Digits
26.05.2020 08:41
What do you mean by a pleasant number?
26.05.2020 08:42
Btw this problem can be solved by converting it into binary strings and checking the length of the repeating period?
26.05.2020 08:50
Mathemagicia wrote: What do you mean by a pleasant number? typo, I meant nice
25.10.2023 00:00
Well, it’s not divided into items but I’ll do it because yes lol. a) What is the largest quantity possible number of numbers that a nice number can have? b) What is the greatest nice number there is? First, let’s do letter a). Notice that the possibilities of the sequences of 3 digits in N are: $111, 112, 121, 122, 211, 212, 221, 222$, i.e 8 numbers. So, we believe we can put all these 8 numbers in N, and that’s possible, we have for example: $1112221211$, and we have here 8 numbers in N: $111, 112, 122, 222, 221, 212, 121, 211$. So, if we have all the numbers possible, then the largest quantity of numbers that a nice number can have is 8. b) Okay, in letter a) we saw that the largest quantity of numbers is 8, so the greatest number will have these 8 numbers, or the maximum possible, obviously. With a few tests, we can get $2221211122$. The reader can exercise himself to figure out why this is the greatest, but here are a few notes: (i) initializes with the maximum number (222), and we can try put the other numbers to get the maximum (ii) well, we can see also that the numbers we got are: $222-221- 212- 121- 211-111-112-122$, which is a sequence almost decreasing always? you can try doing $222-221-212-211-122-121-112-111$, but that’s impossible because $212-211$ is a subsequence impossible to get…