k-mer compositions and permutations with repeat (to be cleaned up)