prosodia = [0, 1, 2, 3, 2, 4, 5, 6, 5, 7, 8, 1, 9, 10, 11, 12, 13, 14, 15, 14, 16, 17, 18, 17, 19, 20, 13, 21, 22, 23, 24, 25, 26, 27, 26, 28, 29, 30, 29, 31, 32, 25, 33, 34, 35, 36, 37, 38, 39, 38, 40, 41, 42, 41, 43, 44, 37, 45, 46, 47, 48, 49, 50, 51, 50, 52, 53, 54, 53, 55, 56, 49, 57, 58, 59, 60, 61, 62, 63, 62, 64, 65, 66, 65, 67, 68, 61, 69, 70, 71, 72, 73, 74, 75, 74, 76, 77, 78, 77, 79, 80, 73, 81, 82, 83, 84, 85, 86, 87, 86, 88, 89, 90, 89, 91, 92, 85, 93, 94, 95, 96, 97, 98, 99, 98, 100, 101, 102, 101, 103, 104, 97, 105, 106, 107, 108, 109, 110, 111, 110, 112, 113, 114, 113, 115, 116, 109, 117, 118, 119, 120, 121, 122, 123, 122, 124, 125, 126, 125, 127, 128, 121, 9, 129, 130, 131, 132, 133, 134, 133, 135, 136, 137, 136, 138, 139, 132, 140, 141, 142]
def unique_index(prosodia):
elems = []
for e in prosodia:
if e not in elems:
elems.append(e)
indexes = {v:i for i, v in enumerate(elems)}
result = [indexes[e] for e in prosodia]
return result
def find_min_period(prosodia):
for i in range(3, len(prosodia)//2+1):
if not len(prosodia)%i:
unique = unique_index(prosodia[:i])
for j in range(i, len(prosodia), i):
if unique != unique_index(prosodia[j:j+i]):
break
else:
return i
print(find_min_period(prosodia))