Python3 Math solution
Code
# Code
```python3 []
from functools import reduce

class Solution:
    def permute(self, n: int, k: int) -> List[int]:
        # very uhly construction trying to express that if we start, we have either n options if number if even
        # or n // 2 + 1 if it's off (in case of 5 we can start with 1,3,5 but not with 2,4).
        # other options says how many nums till the end of the same parity are here, cause they can be changed anyhow
        # and thus they are giving us the total amount of free options
        options = [n if  n % 2 == 0 else n//2 + 1, *((n - i) // 2 + ((n-i) % 2) for i in range(1, n))]
        res = []
        def search(index, non_was, num, n, last_kvadrant):
            if index > n:
                # we passed whole perm, means success
                return

            kvadrant_size = last_kvadrant // options[index-1]
            # allighn with zero-starting indexes
            where = (num - 1) // kvadrant_size

            pool = []

            # if input n is odd number - we must start with odd number, other permutations doesn't make sense
            # because there is more off numbers in permutation than even and we need to make it neighbor with borders to prevent conflicts
            # e.g. if we have n == 5 and we started with 2, we can have something like 2, 1, 4, 3, 5 (and 3,5 is conflict)
            if (n % 2 == 1 and len(res) == 0) or  (len(res) and res[-1] % 2 == 0):
                pool = list(filter(lambda x:x%2==1, non_was))
            elif len(res) == 0:
                pool = non_was
            else:
                pool = list(filter(lambda x:x%2==0, non_was))
            
            if where >= len(pool):
                # we are being pushed outside our boundaries - means unsuccess
                return
            res.append(pool[where])
            non_was.remove(pool[where])
            search(index + 1, non_was, num % kvadrant_size, n, kvadrant_size)
        # reduce calculates product of whole array - number means number of all permutations
        search(1, list(range(1,n+1)), k, n, reduce(lambda x,y: x*y, options))
        return res if len(res) == n else []



        

```
['Python3']