s: [1, 2, 2, 3, 4, 4, 5]$ for i from 1 thru 7 do( curr: s[i], if i>1 and curr=prev then print(i), prev: curr );