def spread_resistor_list(lrs, hrs, nb_states, number):
    """
    This function help the create_res_states() function

    Parameters
    ----------
    number : int
        The number of distribution to create

    lrs : float
        Low Resistance State (LRS) (Ohm)

    hrs : float
         High Resistance State (HRS) (Ohm)

    nb_states : int
        The number of states used to program the memristor.

    Returns
    ----------
    list_resistor : iterable[float]
        list of resistor (Ohm)

    """
    list_resistor = []
    for j in range(number):
        # This equation can be optimized. It create a number of different resistance values.
        temp = [int(lrs + i * ((hrs -
                lrs) / (nb_states - 1)) +
                ((-1) ** j) * ((j + 1) // 2) * ((hrs - lrs)
                / ((nb_states - 1) * 4 * 2))) for i in range(nb_states)]
        temp[0] = lrs
        temp[-1] = hrs
        list_resistor.append(temp)
    return list_resistor