Skip to main content
1 of 2
tsh
  • 35.6k
  • 2
  • 34
  • 129

JavaScrit, 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