def _interval_scan_away(lower, upper, n):
    """Scan for a representative with n=n whose envelope encloses lower and upper.
    Returns two things:
      True, if the interval is provably too small for the bound, else False
        (i.e. we found a representative whose envelope is totally enclosed between lower and upper).
      None, if no enclosing representative is found, else the representative.
    """
    if lower._inexact or upper._inexact:
        raise ValueError('enclose: can only scan exact numbers')
    elif lower.negative or upper.negative:
        raise ValueError('enclose: can only scan positive numbers')
    elif not lower < upper:
        raise ValueError(
            'enclose: can only scan ordered envelope, got [{}, {}]'.format(
            lower, upper))
    rep = lower.trunc(n)
    if rep.is_exactly_zero():
        rep = rep.explode(sided=True, full=False)
    else:
        rep = rep.explode(sided=False, full=False)
    while True:
        bound_lo, bound_hi = rep.bounds()
        bottom_enclosed = bound_lo <= lower
        top_enclosed = upper <= bound_hi
        if bottom_enclosed and top_enclosed:
            return False, rep
        elif not (bottom_enclosed or top_enclosed):
            if rep.interval_sided:
                rep = rep.away(const_p=False)
            else:
                return True, None
        elif bottom_enclosed:
            rep = rep.away(const_p=False)
        else:
            return False, None
