Skip to main content
2 of 2
added 1 character in body

JavaScript, 112 bytes

k=>x=>(r=Array(k).fill(''),[...`${x<0?2*~x+1:2*x}`].map((c,i,s)=>r[(s.length-i)%k]+=c),r.map(v=>v&1?~(v/2):v/2))
  1. convert to non-negative
  2. (n*k+i)th digit to i-th number
  3. convert back
tsh
  • 35.6k
  • 2
  • 34
  • 129