# Problem 6.

In the alphabet of the inhabitants of the magical planet ABV2020, there are only three letters: A, B, and V, from which all words are formed. In any word, two identical letters cannot be adjacent, and each of the three letters must be present in any word. For example, the words ABV, VABAVAB, and BVBVAB are permissible, while the words VAV, ABAAVA, and AVABBB are not. How many 20-letter words are there in the dictionary of this planet?
# Answer: 1572858

Solution. The first letter can be any of the three, and for each subsequent letter, there are two options. This results in $3 \cdot 2^{19}$ words. However, we need to subtract from this the words that are made up of only two letters, not three. There are 6 such words. Therefore, we get $3 \cdot 2^{19}-6=1572858$ different words.

## B-2

In the alphabet of the inhabitants of the magical planet ABV2020, there are only three letters: A, B, and V, from which all words are formed. In any word, two identical letters cannot be adjacent, and each of the three letters must be present in any word. For example, the words AVB, VAVAVA, BVVVBVA are valid, while the words VAV, ABAAVA, AVABB are not. How many 18-letter words are there in the dictionary of this planet?

Answer: 393210

## B-3

In the alphabet of the inhabitants of the magical planet ABV2020, there are only three letters: A, B, and V, from which all words are formed. In any word, two identical letters cannot be adjacent, and each of the three letters must be present in any word. For example, the words AVB, VAVAVA, BVVVBVA are valid, while the words VAV, ABAAVA, AVABB are not. How many 19-letter words are there in the dictionary of this planet?

Answer: 786426

## B-4

In the alphabet of the inhabitants of the magical planet ABV2020, there are only three letters: A, B, and V, from which all words are formed. In any word, two identical letters cannot be adjacent, and each of the three letters must be present in any word. For example, the words AVB, VAVAVA, BVVVBVA are valid, while the words VAV, ABAAVA, AVABB are not. How many 17-letter words are there in the dictionary of this planet?

Answer: 196602

## Lomonosov Olympiad for Schoolchildren in Mathematics

Preliminary stage $2020 / 21$ academic year for $5-6$ grades

## B-1

#