JSFiddle - React, Tailwind, and code Playground
JavaScript
function e(n, k) {
b = [];
for (j = 0; j < n; j++) b[j] = false;
d = [];
function a(c) {
for (i = 0; i < n; i += c) b[i] = !b[i];
c < k && a(c + 1)
}
a(1);
for (i in b) b[i] && d.push(i);
return d
}
alert(e(100,100))