def test_limit_points(sequence, max_number_of_lp):
    """
    Return the number (color coded) of limit points in a sequence.
    Points within a distance epsilon are indistinguishable.
    """
    if len(sequence) == 1:
        return 0  # undefined
    epsilon = 1e-10
    try:
        for i in range(2, max_number_of_lp+2):
            if abs(sequence[-1]-sequence[-i]) < epsilon:
                return i-1
        return 0  # undefined
    except (OverflowError, ValueError):
        return 0