computing permuted indexes in runtime