B4. The infinite sequence of numbers

$$
0,1,2,2,1,-1,-2,-1,1,3, \ldots
$$

satisfies the following rule. For each quadruple of consecutive numbers $\ldots, a, b, c, d, \ldots$ in the sequence, it always holds that $d$ is equal to $c$ minus the smallest of the two numbers $a$ and $b$. Thus, the ninth number in the sequence is equal to $-1-(-2)=1$ and the tenth number is equal to $1-(-2)=3$. Calculate the 100th number in the sequence.
B4. With a little bit of arithmetic, we find more numbers in the sequence:

$$
\begin{aligned}
& 0, \quad 1, \quad 2, \quad 2, \quad 1, \quad -1, \quad -2, \quad -1, \quad 1, \quad 3, \quad 4, \quad 3, \quad 0, \quad -3, \quad -3, \\
& 0, \quad 3, \quad 6, \quad 6, \quad 3, \quad -3, \quad \ldots
\end{aligned}
$$

We see a clear pattern: after fifteen terms, the sequence repeats, but with all terms multiplied by three. To understand that the sequence indeed continues this pattern, consider the following. Each number in the sequence is determined by its three predecessors. Suppose now that three consecutive numbers in the sequence $a, b, c$ repeat fifteen positions later, but multiplied by a factor of 3:

$$
\ldots, a, b, c, d, \ldots, 3a, 3b, 3c, \ldots
$$

The number that follows $3a, 3b, 3c$ is (by definition) equal to $3c$ minus the smallest of $3a$ and $3b$. This is exactly three times as much as: $c$ minus the smallest of $a$ and $b$. In other words: it is exactly three times as much as $d$. If three consecutive numbers in the sequence repeat fifteen positions later (multiplied by 3), this automatically holds for the next number as well, and thus also for the number after that, etc.

With the discovered regularity, we see that the hundredth number is equal to the tenth number (3), but multiplied by 3 $\frac{90}{15}=6$ times. This results in: $3 \cdot 3^{6}=2187$.