ListA = {14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 12, 12, 12, 14, 14, 14, 12,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 12, 14, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 54, 48, 48, 48, 52, 46,
46, 46, 46, 52, 52, 54, 62, 56, 52, 54, 50, 46, 44, 44, 44, 44, 44,
54, 38, 40, 46, 52, 44, 52, 50, 56, 54, 54, 56, 46, 46, 56, 48, 58,
60, 54, 54, 46, 54, 50, 52, 54, 48, 56, 48, 56, 48, 52, 44, 54, 56,
44, 54, 44, 54, 50, 50, 38, 40, 44, 44, 52, 42, 42, 42, 48, 44, 44,
44, 42, 38, 42, 42, 44, 38, 36, 36, 40, 40, 42, 40, 38, 38, 40, 40,
42, 40, 40, 42, 44, 68, 46, 38, 40, 62, 54, 40, 40, 40, 40, 42, 42,
42, 42, 44}
I need to locate the start and end positions of any sequence of repeated successive numbers. So if a repeat goes on for 10 successive numbers I need the first and tenth position, and similar for shorter repeat of 3 successive numbers I need the first and third position (see first two sequences in ListA above).
I expected the result to be another list. The first two entries for results of ListA
would be ListB = {{1, 10}, {11, 13}, ..., etc.}
. Single numbers in ListA
with no sequence can be ignored.