def van_der_corput(n, base=2):
    """Returns the nth element of the van der Corput sequence with the given
    base."""
    vdc, denom = 0.0, 1.0
    while n:
        denom *= base
        n, rem = divmod(n, base)
        vdc += rem / denom
    return vdc