Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Sandbox

Post History

71%
+3 −0
Sandbox The Ludic Numbers[FINALIZED]

posted 3y ago by Razetime‭  ·  edited 1y ago by trichoplax‭

#3: Post edited by user avatar trichoplax‭ · 2023-06-19T10:25:29Z (over 1 year ago)
Add finalized tag now that the sandbox can be filtered to exclude tags
The Ludic Numbers[FINALIZED]
The Ludic Numbers are a sequence that pops up when you apply the sieve of eratosthenes to the natural numbers, completely removing the numbers every iteration.

Here is how they are generated:

The Ludic numbers start with the lists:
```
l = [1]
n = [2,3,4,5,6,7,8,9,10....]
```

Every iteration, we take the first element `x` in `n`, add it to the list, and remove every `x`th number in `n`, including `x`.

```
l = [1,2]
n = [3,5,7,9,11,...]
```

By repeating this process an infinite number of times, we can get the full list of Ludic numbers.

# Challenge
For this sequence, you can
*    Take an index \$n\$ and output the \$n^{th}\$ term, either 0 or 1 indexed.
*    Take a positive integer \$n\$ and output the first \$n\$ terms.
*    Output the whole sequence as an infinite list.

# Testcases
```
1		1
2		2
3		3
4		5
5		7
6		11
7		13
8		17
9		23
10		25
11		29
12		37
13		41
14		43
15		47
16		53
```

The first 56 values can be seen here: [A003309](http://oeis.org/A003309/list).

Reference implementations can be found at [Rosetta Code](https://rosettacode.org/wiki/Ludic_numbers).

# Scoring
This is code-golf. Shortest answer in every language wins.
#2: Post edited by user avatar Razetime‭ · 2021-09-21T04:28:58Z (over 3 years ago)
  • The Ludic Numbers
  • The Ludic Numbers[FINALIZED]
  • The Ludic Numbers are a sequence that pops up when you apply the sieve of eratosthenes to the natural numbers, completely removing the numbers every iteration.
  • Here is how they are generated:
  • The Ludic numbers start with the lists:
  • ```
  • l = [1]
  • n = [2,3,4,5,6,7,8,9,10....]
  • ```
  • Every iteration, we take the first element `x` in `n`, add it to the list, and remove every `x`th number in `n`.
  • ```
  • l = [1,2]
  • n = [3,5,7,9,11,...]
  • ```
  • By repeating this process an infinite number of times, we can get the full list of Ludic numbers.
  • # Challenge
  • For this sequence, you can
  • * Take an index \$n\$ and output the \$n^{th}\$ term, either 0 or 1 indexed.
  • * Take a positive integer \$n\$ and output the first \$n\$ terms.
  • * Output the whole sequence as an infinite list.
  • The first 56 values can be seen here: [A003309](http://oeis.org/A003309/list).
  • Reference implementations can be found at [Rosetta Code](https://rosettacode.org/wiki/Ludic_numbers).
  • # Scoring
  • This is code-golf. Shortest answer in every language wins.
  • The Ludic Numbers are a sequence that pops up when you apply the sieve of eratosthenes to the natural numbers, completely removing the numbers every iteration.
  • Here is how they are generated:
  • The Ludic numbers start with the lists:
  • ```
  • l = [1]
  • n = [2,3,4,5,6,7,8,9,10....]
  • ```
  • Every iteration, we take the first element `x` in `n`, add it to the list, and remove every `x`th number in `n`, including `x`.
  • ```
  • l = [1,2]
  • n = [3,5,7,9,11,...]
  • ```
  • By repeating this process an infinite number of times, we can get the full list of Ludic numbers.
  • # Challenge
  • For this sequence, you can
  • * Take an index \$n\$ and output the \$n^{th}\$ term, either 0 or 1 indexed.
  • * Take a positive integer \$n\$ and output the first \$n\$ terms.
  • * Output the whole sequence as an infinite list.
  • # Testcases
  • ```
  • 1 1
  • 2 2
  • 3 3
  • 4 5
  • 5 7
  • 6 11
  • 7 13
  • 8 17
  • 9 23
  • 10 25
  • 11 29
  • 12 37
  • 13 41
  • 14 43
  • 15 47
  • 16 53
  • ```
  • The first 56 values can be seen here: [A003309](http://oeis.org/A003309/list).
  • Reference implementations can be found at [Rosetta Code](https://rosettacode.org/wiki/Ludic_numbers).
  • # Scoring
  • This is code-golf. Shortest answer in every language wins.
#1: Initial revision by user avatar Razetime‭ · 2021-09-17T07:19:21Z (over 3 years ago)
The Ludic Numbers
The Ludic Numbers are a sequence that pops up when you apply the sieve of eratosthenes to the natural numbers, completely removing the numbers every iteration.

Here is how they are generated:

The Ludic numbers start with the lists:
```
l = [1]
n = [2,3,4,5,6,7,8,9,10....]
```

Every iteration, we take the first element `x` in `n`, add it to the list, and remove every `x`th number in `n`.

```
l = [1,2]
n = [3,5,7,9,11,...]
```

By repeating this process an infinite number of times, we can get the full list of Ludic numbers.

# Challenge
For this sequence, you can
*    Take an index \$n\$ and output the \$n^{th}\$ term, either 0 or 1 indexed.
*    Take a positive integer \$n\$ and output the first \$n\$ terms.
*    Output the whole sequence as an infinite list.

The first 56 values can be seen here: [A003309](http://oeis.org/A003309/list).

Reference implementations can be found at [Rosetta Code](https://rosettacode.org/wiki/Ludic_numbers).

# Scoring
This is code-golf. Shortest answer in every language wins.