The first task of last week's Weekly Challenge
was to generate van Eck's sequence:
0, 0, 1, 0, 2, 0, 2, 2, 1, 6, 0, 5, 0, 2, 6, 5, 4, 0,...
The first challenge is to understand just what van Eck's sequence is,
as the various online explanations are less than instantly helpful.
Van Eck's sequence is a list of integers starting at zero, where the next number
in the sequence is given by the distance between the current number
and the nearest preceding occurrence of that same number.
For example, if the current number at index N (let's call it: Aₙ) is 7,
then to compute the number at index N+1 we look back through the
sequence for the most recent preceding occurrence of 7
(at some earlier index M). Then the next number in the sequence
is simply the distance between those two occurrences of 7.
Namely: N - M