Use repeated_permutation to calc box_indices