Олимпиадный тренинг

Задача 38682. Thue-Morse string


Задача

Темы:
Thue-Morse string — an infinite sequence of zeros and ones, which is obtained as follows. At the beginning of the sequence, the number 0 is written. Then the following actions are repeated: the same number of characters are added to the already written part of the sequence as already written out before, while the numbers 0 change to 1, the numbers 1 change to 0.

That is, 1 will be appended to sequence 0, it will be 01. Then sequence 10 will be appended to sequence 01, it will be 0110. Then 1001 will be appended to it, it will be 01101001. Then the sequence 0110100110010110 will be obtained, etc.
Complete the tasks.
1. Write down the 5 characters of the sequence, starting with the 17th character (i.e. characters 17 to 21).
2. Write down 5 characters of the sequence, starting from the 60th.
3. Write down 5 characters of the sequence, starting from the 100th.
4. Write down 5 characters of the sequence, starting from the 200th.
5. Write down 5 symbols of the sequence starting from 2050.
The answer to this task is five sequences, each containing exactly 5 characters "0" or "1" — answers to tasks 1 – 5.
If you cannot give an answer to some task, write any five characters "0" in the appropriate sequence. or "1".
Separate each sequence from another with a semicolon (;).

Sample response entry:
10101;10101;10101;10101;10101