OFFSET
0,2
COMMENTS
These numbers are homogeneously distributed with a density of approximately 0.59060.
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
Eric Weisstein's World of Mathematics, Sieve
Wikipedia, Sieve theory
EXAMPLE
In the first round one starts with 1 and the numbers 2,4,8,16,... are removed leaving 1,3,5,6,7,9,10,11,12,13,14,15,17,18,19,20,... The third successor of 3 is now 7 and the 7th of 7 is 15 leaving 1,3,5,6,8,9,10,11,12,13,14,16,...
MATHEMATICA
S = Range[200]; S0 = {}; i = 1;
While[S != S0, ii = NestWhileList[#+S[[#]] &, i+S[[i]], # <= Length[S]&]; S0 = S; S = Delete[S, List /@ Select[ii, # <= Length[S]&]]; i++];
S (* Jean-François Alcover, Dec 11 2019 *)
PROG
(Haskell)
a056875 n = a056875_list !! (n-1)
a056875_list = f [1..] where
f zs = head zs : f (g zs) where
g (x:xs) = us ++ g vs where (us, vs) = splitAt (x - 1) xs
-- Reinhard Zumkeller, Sep 11 2013
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
Thomas Schulze (jazariel(AT)tiscalenet.it), Sep 02 2000
STATUS
approved