"Lucky" numbers are numbers which are "lucky" enough to survive the following "sieve" procedure:

Start with the set of the first N positive integers, and select 1 to be the first lucky number.

Repeat the following until no more deletions occur:

select i to be the least number on the list not yet found to be lucky. Counting from the start of the list, remove every ith number.

So for example, running this on the integers from 1 to 100, my first pass selects i = 2 and so strikes out every other number, leaving only the odd numbers. On the second pass, I select i = 3, and strike out every third odd number, getting the following list:

[1, 3, 7, 9, 13, 15, 19, 21, 25, 27, 31, 33, 37, 39, 43, 45, 49, 51, 55, 57, 61, 63, 67, 69, 73, 75, 79, 81, 85, 87, 91, 93, 97, 99]

On the next pass, i = 7, and every seventh number is deleted from the list, leaving

7 [1, 3, 7, 9, 13, 15, 21, 25, 27, 31, 33, 37, 43, 45, 49, 51, 55, 57, 63, 67, 69, 73, 75, 79, 85, 87, 91, 93, 97, 99]

9 [1, 3, 7, 9, 13, 15, 21, 25, 31, 33, 37, 43, 45, 49, 51, 55, 63, 67, 69, 73, 75, 79, 85, 87, 93, 97, 99]

And we proceed in this vein until we get

[1, 3, 7, 9, 13, 15, 21, 25, 31, 33, 37, 43, 49, 51, 63, 67, 69, 73, 75, 79, 87, 93, 99]

As I say, this shouldn't be a very difficult piece of code to write, but there are a few places where you can get stuck, so you might have to think about it a little bit.

If you become curious about this sequence, see the entry on wikipedia, and also the entry at OEIS

Implementation tip: I find the enumerate function to be quite useful in this sort of program. It allows me to work with a list's values and its indices inside a list comprehension, rather than a loop, which I find congenial. If you haven't played with this, give it a go. It's often useful for streamlining your code without making it cryptic.

Once you've got it running, you might want to look at the similarities between this set and the primes, which are interesting. This problem should also remind you of the well-known Josephus problem, with which it shares some characteristics.

Have fun!