from typing import Collection
from typing import Dict


def A181391(start: int = 0, limit: int = 20) -> Collection[int]:
    """Van Eck's sequence: For n >= 1,
    if there exists an m < n such that a(m) = a(n),
    take the largest such m and set a(n+1) = n-m;
    otherwise a(n+1) = 0. Start with a(1)=0.
    """
    sequence = [0]
    last_pos: Dict[int, int] = {}

    for i in range(start + limit):
        new_value = i - last_pos.get(sequence[i], i)
        sequence.append(new_value)
        last_pos[sequence[i]] = i

    return sequence[start : start + limit]