def _reciprocal_cycle_length(n):
    """
    Finds reciprocal cycles by using long division and looking for remainders in the division that has been seen before.
    If a remainder has been seen before there must be a cycle.
    """
    remainder = 10 * (1 % n)
    seen_remainders_and_offset = {}
    offset = 0
    while remainder not in seen_remainders_and_offset:
        seen_remainders_and_offset[remainder] = offset
        if remainder % n == 0:
            return 0
        else:
            remainder = 10 * (remainder % n)
        offset += 1
    return offset - seen_remainders_and_offset[remainder]