search = (k, pattern, nbSol = 1, maxExp = 10000n) => {
const match = [];
let a = 1n;
for (let n = 1n; n < maxExp; n++) {
const t = a * k;
const s = String(t);
if (s.includes(pattern)) {
match.push({ k, n, digits: s.length });
if (match.length === nbSol) break;
}
a = t;
}
return match.length >= 1 && nbSol === 1
? match[0]
: match.length > 0
? match
: false;
}