JSFiddle - React, Tailwind, and code Playground

by evgkch

JavaScript

const ipi = depth => i => depth >= 0 ? [i, ...ipi(depth-1)(i>>2)] : [];

const pmask = (depth, l = 0) => {
	const mask = new Uint32Array(depth + 1);
  let acc = 0;
  
  for (let n = 0; n <= depth; n++)
  {
  	acc += (1 << n << n);
    mask[n] = acc;
  }
  
  return mask;
}

const pmask5 = pmask(5);

const repi = ipi => 

console.log(pmask(5))