Please in order to save solutions and appear on the leaderboards.

Lucky Numbers

Details

The lucky numbers are an integer sequence that results from a certain "sieve" process:

Start from the odd natural numbers a = 1 3 5 7 … viewed as a 1-indexed infinite sequence.

For each k = 2…∞, replace a with the result of deleting every a[k]-th term from a.

Print the first 1,000 terms of the resulting sequence.

Start:
    1 3 5 7 9 11 13 15 …
      ^
Delete every 3rd term and advance:
    1 3 7 9 13 15 19 21 …
        ^
Delete every 7th term and advance:
    1 3 7 9 13 15 21 25 …
          ^
0 bytes, 0 chars
Restore solution
All
Compiled from AT&T syntax to x86-64 Linux. Use syscalls to write output.
TeX is an experimental language, no solutions will be saved. Please leave feedback on the GitHub issue.
ctrl + enter or

Delete Solution

Are you sure you want to delete your solution(s) for Lucky Numbers?

If you have seperate bytes and chars solutions then both will be deleted.

This is irreversible, please backup any code you care about.

Type I understand and press confirm to continue.