This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A111039 #15 Feb 07 2020 08:22:56 %S A111039 1,3,5,9,11,17,19,21,25,33,35,41,43,49,51,53,57,67,69,75,83,89,97,99, %T A111039 101,107,113,115,117,129,131,137,139,147,149,163,169,171,177,181,193, %U A111039 195,197,211,213,217,227,229,233,243,245,259,261,267,277 %N A111039 Start with the positive integers, and at the n-th step, remove every (a(n)+1)-st term from the list of numbers remaining, for n = 1, 2, 3, ... %C A111039 A variation on lucky numbers A000959: To get these, remove at the n-th step every a(n)-th remaining number, except for n = 1, where at the 1st step the even numbers are removed (as here). %e A111039 Start with A = [1, 2, 3, 4, ...]. For n = 1 (the 1st step), we have a(1)+1 = 1+1 = 2, so we remove every 2nd number. Then only the list A' of odd numbers remains. %e A111039 For n = 2 (the 2nd step), we have a(2)+1 = 3+1 = 4, so we remove every 4th number from the list A', it remains A'' = [1,3,5, 9,11,13, 17,19,21, 25,...]. %e A111039 For n = 3 (the 3rd step), we have a(3) + 1 = 5 + 1 = 6, so we remove every 6th number from the above list A'' of remaining numbers. It remains A''' = [1,3,5,9,11, 17,19,21,25,27, 31,...]. %e A111039 For n = 4 (the 4th step), we have a(4)+1 = 9+1 = 10, and we remove every 10th number from the list A'''. And so on. %e A111039 a(4) = 9, not 7 because 7 was removed during the 2nd iteration with the rest of the (a(2)+1)th numbers (15, 23, 31, 39, etc.) in the sequence remaining after the 1st iteration. %o A111039 (PARI) A111039_upto(N,A=[1..N])={for(i=1,N, (i>#A||A[i]>#A)&& break; my(t=A[i]+1); A=vecextract(A,2^#A-1-2^(#A\t*t)\(2^t-1)<<A[i])); A} \\ _M. F. Hasler_, Jan 29 2020 %Y A111039 Cf. A000959 (lucky numbers). %K A111039 easy,nonn %O A111039 1,2 %A A111039 _Brent Lehman_, Oct 05 2005 %E A111039 Edited by _M. F. Hasler_, Jan 29 2020