multi-dimensional arithmetic progression