4 ms·
It's also a little confusing because there are sets which do not have a well-defined natural density among the integers, like: leastpow2 x = head $ dropWh
by drostie 12y ago
It's also a little confusing because there are sets which do not have a well-defined natural density among the integers, like:
leastpow2 x = head $ dropWhile (\k -> 2*k <= x) $ map (2^) [0..]
p k = k < 3 * (leastpow2 k `div` 2)
limitless = [k | k <- [0..], k == 0 || p k]
which oscillates between attaining 1/2 and then 2/3 for its partial densities.