%I #22 Feb 26 2024 19:17:25
%S 1,3,5,7,11,13,17,21,23,25,31,35,41,43,45,47,55,57,63,65,73,75,83,87,
%T 95,97,101,105,107,113,123,127,131,133,141,143,147,151,153,161,175,
%U 177,183,185,197,201,211,213,215,217,227,233,235,237,251,255,265,267
%N Pseudo-lucky numbers.
%C Appears to grow more slowly than the Lucky numbers. - _Jon Perry_, Nov 07 2014
%H Jean-François Alcover, <a href="/A249876/b249876.txt">Table of n, a(n) for n = 1..1000</a>
%e 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.
%p L:= [seq(i, i=1..10^3)]:
%p for n from 2 while n < nops(L) do
%p r:= L[n];
%p L:= subsop(seq(r*i=NULL, i=1..nops(L)/r), L);
%p od:
%p L;
%t 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 *)
%o (Python)
%o def listed(n):
%o L=list(range(1,n+1));j=1
%o while L[j] <= len(L):
%o L=[L[i] for i in range(len(L)) if (i+1)%L[j]!=0]
%o j+=1
%o return(L)
%Y Cf. A000959 (Lucky numbers).
%K nonn
%O 1,2
%A _Robert FERREOL_, Nov 07 2014