OFFSET
1,2
LINKS
MATHEMATICA
seq[nmax_, kmax_] := Module[{s = Table[0, {nmax}], c = 0, k = 1, i}, While[c < nmax && k < kmax, i = DivisorSum[k, 1 &, BitOr[#, k] == k &]; If[i <= nmax && s[[i]] == 0, c++; s[[i]] = k]; k++]; s]; seq[20, 5*10^6]
PROG
(PARI) lista(nmax, kmax=oo) = {my(s = vector(nmax), c = 0, k = 1, i); while(c < nmax && k < kmax, i = sumdiv(k, d, bitor(d, k) == k); if(i <= nmax && s[i] == 0, c++; s[i] = k); k++); s};
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, Dec 15 2022
STATUS
approved