OFFSET
1,2
MATHEMATICA
q[n_] := EvenQ[Sum[DigitCount[e, 2, 1], {e, FactorInteger[n][[;; , 2]]}]]; q[1] = True; seq[len_] := Module[{s = Table[0, {len}], n = 1, count = 0, n1, d}, While[count < len, n1 = n; If[q[n], While[q[++n1]]; d = n1 - n; If[d <= len && s[[d]] == 0, count++; s[[d]] = n]]; n = n1 + 1]; s]; seq[16]
PROG
(PARI) is(n) = {my(e = factor(n)[, 2]); !(sum(i = 1, #e, hammingweight(e[i])) % 2); }
lista(len) = {my(s = vector(len), n = 1, count = 0, n1, d); while(count < len, n1 = n; if(is(n), n1++; while(is(n1), n1++); d = n1 - n; if(d <= len && s[d] == 0, count++; s[d] = n)); n = n1 + 1); s};
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, Dec 23 2023
STATUS
approved