The warm-up part it is included in the mandatory one, so it suffices to submit the solution of the latter.

Optional task is not mandatory and counts only for higher grades (see the Course rules).

If you are solving the optional part, put it into the same .py file.

## Warm up: Sequence of Numbers

This is more complicated than the sequnce concocted by Collatz: the next term is computed by multiplying the current turn by 13, adding 1 and then computing the remainder after division by 16, that is, $x_i = (13 x_{i - 1} + 1)\;\%\;16$, where % denotes remainder. The first term of the sequence is 0.

1. Write a program that computes and prints out the first 16 terms of the sequence. The correct output is

0
1
14
7
12
13
10
3
8
9
6
15
4
5
2
11

2. Modify the program to output the first 1000 terms. You'll see that the sequence repeats the same 16 terms, which is boring, so ...

3. ... modify the formula to compute the next term like this: $x_i = (1664525\,x_{i - 1} + 1013904223)\;\%\;2^{32}$. Now the sequence starts with

0
1013904223
1196435762
3519870697
2868466484
1649599747
...


## Mandatory task: Sequence of Rooms

There's a corridor with 10 rooms. The owner is a computer scientist, hence they are numbered from 0 to 9, not from 1 to 10.

Ana visits the rooms in random order: she computes the terms of the above sequence, for each term she computes the right-most digit and visits the corresponding room. So for the above sequence, she visits rooms 0, 3, 2, 7, 4, 7, ...

She has too much time (perhaps she's self-isolating), so she repeats this 1000 times. Write a program (or change the above one) to simulate her procedure. The program should not output individual room numbers, but instead just report how many times did she visit the room number 6.

(Unless I'm mistaken, the answer is 96.)

Berta is also self-isolating and wanders through the same rooms, just using a different formula: $x_i = (22695477\,x_{i - 1} + 1)\;\%\;2^{32}$. She also visits the rooms based on the right-most digit. She also does it 1000 times.