```
class Solution(object):
def combinationSum3(self, k, n):
"""
:type k: int
:type n: int
:rtype: List[List[int]]
"""
combinations = []
masks = [ 1 << x for x in range(9)]
for rank in range(2 ** 9):
nums = [x+1 for x in range(9) if rank & masks[x] != 0]
if len(nums) == k and sum(nums) == n:
combinations.append(nums)
return combinations
```