You can break this problem into two parts:
1) Find all size subsets kfrom a size set n.
2) For each such subset, find all permutations of the subset of size k.
2, . 1 . " k [0...n-1].
1) [0...k-1]
2) , S:
2a) j , j ∈ S ∧ j+1 ∉ S. j == n-1, ; .
2b) , j, i...j-1 ( - , j ). i 0, i-i...j-i-1. j j+1.