We are given integers 0 ≤ G 1 ≤ G 2 = 0 and a sequence S N = a 1 , a 2 , ..., a N of N integers. The goal is to compute the minimum number of insertions and deletions necessary to transform S N into a valid sequence, where a sequence is valid if it is nonempty, all elements are integers, and all the differences between consecutive elements are between G 1 and G 2 . For this problem from the database theory literature, previous dynamic programming algorithms have running times O(N 2 ) and O(A · N log N ), for a parameter A unrelated to N . We use a geometric data structure to obtain a O(N log N log log N ) running time.