Generalized arithmetic progression

In mathematics, a multiple arithmetic progression, generalized arithmetic progression or a semilinear set, is a generalization of an arithmetic progression equipped with multiple common differences – whereas an arithmetic progression is generated by a single common difference, a generalized arithmetic progression can be generated by multiple common differences. For example, the sequence formula_1 is not an arithmetic progression, but is instead generated by starting with 17 and adding either 3 "or" 5, thus allowing multiple common differences to generate it. 
Finite generalized arithmetic progression.
A finite generalized arithmetic progression, or sometimes just generalized arithmetic progression (GAP), of dimension "d" is defined to be a set of the form
where formula_3. The product formula_4 is called the size of the generalized arithmetic progression; the cardinality of the set can differ from the size if some elements of the set have multiple representations. If the cardinality equals the size, the progression is called proper. Generalized arithmetic progressions can be thought of as a projection of a higher dimensional grid into formula_5. This projection is injective if and only if the generalized arithmetic progression is proper.
Semilinear sets.
Formally, an arithmetic progression of formula_6 is an infinite sequence of the form formula_7, where formula_8 and formula_9 are fixed vectors in formula_6, called the initial vector and common difference respectively. A subset of formula_6 is said to be linear if it is of the form
where formula_13 is some integer and formula_14 are fixed vectors in formula_6. A subset of formula_6 is said to be semilinear if it is a finite union of linear sets.
The semilinear sets are exactly the sets definable in Presburger arithmetic.