def fraction_cycle_length(denominator):
    """Return the number of digits in the cycle part of a fraction.

    For instance, in 1/3 (0.3333...), '3' is the recurring cycle. The length of
    that cycle is 1.

    In 1/7 (0.142857142857142...), '142857' is the recuring cycle. The length of
    the cycle is 6.
    """
    # counter for the number of digits generated
    digit_count = 0
    # accumulator for the current number to be divided
    accumulator = 1
    # values encountered for the accumulator
    accumulators = []
    # while there is a remainder to the division
    while accumulator != 0:
        # if the current accumulator can be divided by the denominator
        if accumulator >= denominator:
            # the digit to add to the number is the result of that division
            digit = accumulator // denominator
            # if we have never had that accumulator before
            if not accumulator in accumulators:
                accumulators.append(accumulator)
            else:
                # if we have already met that accumulator before, return the
                # number of digits between two occurences
                return digit_count - accumulators.index(accumulator)
            # subtract the result of the division from the accumulator
            accumulator -= digit * denominator
            # add a digit to the digit count
            digit_count += 1
        else:
            # the current accumulator cannot be divided by the denominator,
            # multiply it by 10
            accumulator *= 10
    # divides evenly, 0 cycle length
    return 0