indexlist = [0, 7, 8, 12, 19, 25, 26, 27, 29, 30, 31, 33]
last = -1000
resultlist = []
for item in indexlist:
    if item > last + 5:
        resultlist.append(item)
last = item
resultlist
extracting numbers from list