Cody Problem 45367 involved the Sieve of Eratosthenes, and Cody Problem 50811 involved the Sieve of Flavius Josephus. To apply the golden sieve, start with the natural numbers and at the nth step, take the sequence, which we will call a, and delete the term in the
position.
In the first step, delete the term in the
position to get 2, 3, 4, 5, 6, 7,…Then in the second step, delete the term in the
position (i.e., 4) to get 2, 3, 5, 6, 7, 8, 9,…In the third step, delete the term in the
position (i.e., 7) to get 2, 3, 5, 6, 8, 9, 10,…Et cetera.
Write a function that returns the nth term in the sequence after an infinite number of steps.
Solution Stats
Problem Comments
3 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers19
Suggested Problems
-
Find the sum of all the numbers of the input vector
54615 Solvers
-
Calculate the Levenshtein distance between two strings
1510 Solvers
-
Back to basics 21 - Matrix replicating
1809 Solvers
-
Implement a bubble sort technique and output the number of swaps required
394 Solvers
-
381 Solvers
More from this Author323
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
OK, but you can you *derive* that formula?
Does “look up in OEIS” count as “derive”?
Tim: You, William, David, and others have figured me out. I suppose there are worse habits than repeatedly clicking the "Webcam" button on OEIS.