listA = [0, 1, 2, 1, 2, 1, 2, 3, 4, 5, 3, 4, 5, 6, 0]
listB = [0, 1, 2, 1, 2, 1, 0]

def get_repeated_seq(seq, start, length):
    ref = seq[start:start + length]
for pos in range(start + length, len(seq) - length):
    compare = seq[pos:pos + length]
if compare == ref:
    print(('Found', ref, 'at', pos))
return pos
return False

def get_repeated_seqs(seq):
    for size in reversed(list(range(2, len(seq) / 2))):
        for pos in range(0, len(seq) - size):
            print('Check rep starting at pos %s for size %s' % (pos, size))
get_repeated_seq(seq, pos, size)
print(get_repeated_seqs(listA))
Remove repeated sequence of integers from list in Python