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, ...
1, 3, 5, 9, 11, 17, 19, 21, 25, 33, 35, 41, 43, 49, 51, 53, 57, 67, 69, 75, 83, 89, 97, 99, 101, 107, 113, 115, 117, 129, 131, 137, 139, 147, 149, 163, 169, 171, 177, 181, 193, 195, 197, 211, 213, 217, 227, 229, 233, 243, 245, 259, 261, 267, 277
Offset: 1
Examples
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. 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,...]. 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,...]. 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. 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.
Crossrefs
Cf. A000959 (lucky numbers).
Programs
-
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)<M. F. Hasler, Jan 29 2020
Extensions
Edited by M. F. Hasler, Jan 29 2020
Comments