|
MATHEMATICA
|
f[p_, e_] := 2^DigitCount[e, 2, 1] - 1; c[1] = 0; c[n_] := Plus @@ f @@@ FactorInteger[n]; seq[len_, nmax_] := Module[{s = Table[0, {len}], k = 0, n = 1, i}, While[n < nmax && k < len, i = c[n]; If[c[n + 1] == i && i <= len && s[[i]] == 0, k++; s[[i]] = n]; n++]; TakeWhile[s, # > 0 &]]; seq[8, 3*10^6]
|