def _corput(index, base):
    """Generate the nth Van der Corput number."""
    x = 0
    norm = 1.0/base

    while index > 0:
        x += (index % base)*norm
        index //= base
        norm /= base

    return x