Enumerating Inclusion-Maximal Arithmetic Progressions
arXiv:2606.11067
Abstract
We present a simple enumeration algorithm for solving a problem from mathematical and computational music analysis where, given a strictly increasing integer sequence, , with entries and maximum value , the task is to enumerate all in this sequence. An IMAP is a subsequence, with integers, in which (i) the difference between any two consecutive integers is the same number, (i.e., is an ), (ii) cannot be further extended to the left or to the right with any additional integers from while still remaining an arithmetic progression (i.e., is a arithmetic progression), and (iii) there is no other maximal arithmetic progression, , which contains (i.e., is an arithmetic progression). We further provide proofs for the expected number of IMAPs in random integer sequences, , and a bound on their order of growth. Finally, we provide empirical experiments comparing both (a) the practical running time performance of the proposed algorithm against that of a previously known algorithm which has higher time complexity , and (b) the actual enumerated number of IMAPs to that of their mathematically expected number. Notably, the proposed algorithm demonstrates a significant improvement in running time over the previously known algorithm, and in immediate practical applications, will allow for more efficient analysis of large and rhythmically complex musical pieces.