Implemented based on this analysis http://bangbingsyb.blogspot.com/2014/11/leetcode-permutation-sequence.html

```
class Solution:
# @param {integer} n
# @param {integer} k
# @return {string}
def getPermutation(self, n, k):
nums, result = [i + 1 for i in range(n)], ''
while n > 0:
totalCount = math.factorial(n - 1)
index = (k - 1) / totalCount
result += str(nums.pop(index))
n -= 1
k %= totalCount
return result
```