def is_tandem_repeat(start, stop, unitlength, sequence):
    """

    :param start: the start (inclusive) of a tandem repeat sequence
    :param stop: the stop (exclusive) of a tandem repeat sequence
    :param unitlength: the unit length of the repeat sequence
    :param sequence: the sequence to which the coordinates refer
    :return: boolean True or False if the tandem repeat is in the sequence.
    """
    subseq = sequence[start:stop]
    first_unit = subseq[:unitlength]
    subseq = subseq[unitlength:]
    while subseq:
        thisunit = subseq[:unitlength]
        subseq = subseq[unitlength:]
        if not first_unit.startswith(thisunit):
            return False
    return True