OFFSET
1,2
COMMENTS
Appears to grow more slowly than the Lucky numbers. - Jon Perry, Nov 07 2014
LINKS
Jean-François Alcover, Table of n, a(n) for n = 1..1000
EXAMPLE
Start with the natural numbers. The 2nd number is 2, so delete every 2nd number, leaving 1 3 5 7 9 11 13 15 17 19...; the 3rd number remaining is 5, so delete every 5th number, leaving 1 3 5 7 11 13 15 17 ...; now delete every 7th number, leaving 1 3 5 7 11 13 17 ...; now delete every 11th number; etc.
MAPLE
L:= [seq(i, i=1..10^3)]:
for n from 2 while n < nops(L) do
r:= L[n];
L:= subsop(seq(r*i=NULL, i=1..nops(L)/r), L);
od:
L;
MATHEMATICA
FixedPoint[Function[{L}, n++; Delete[L, List /@ (L[[n]]*Range[Quotient[Length[L], L[[n]] ]])]], n=1; Range[1000]] (* Jean-François Alcover, Nov 27 2014 *)
PROG
(Python)
def listed(n):
L=list(range(1, n+1)); j=1
while L[j] <= len(L):
L=[L[i] for i in range(len(L)) if (i+1)%L[j]!=0]
j+=1
return(L)
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert FERREOL, Nov 07 2014
STATUS
approved