How to resolve the algorithm Sisyphus sequence step by step in the Phix programming language
How to resolve the algorithm Sisyphus sequence step by step in the Phix programming language
Table of Contents
Problem Statement
The Sisyphus sequence is an infinite sequence of positive integers that was devised in 2022 by Eric Angelini and Carole Dubois. The first term is 1. Subsequent terms are found by applying the following rule: 1 is odd and so the second term is: 1 + 2 = 3, because 2 is the smallest prime not yet added. 3 is odd and so the third term is: 3 + 3 = 6, because 3 is the smallest prime not yet added. 6 is even and so the fourth term is : 6 ÷ 2 = 3, and so on. Find and show on this page (in 10 lines of 10 terms), the first 100 terms of the sequence. What are the 1,000th, 10,000th, 100,000th and 1,000,000th terms of the sequence and, in each case, what is the highest prime needed to reach them? If it is difficult or impossible for your language or output device to meet all of these requirements, then just do what you reasonably can. What are the 10 millionth and 100 millionth terms and the highest prime needed to reach each one? By the time the 100 millionth term is reached, which number(s) under 250:
What is the number of the first term to equal 36? This was originally set as a challenge by Neil Sloane who was worried by its non-appearance and found by Russ Cox.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Sisyphus sequence step by step in the Phix programming language
Source code in the phix programming language
You may also check:How to resolve the algorithm 100 prisoners step by step in the Lua programming language
You may also check:How to resolve the algorithm Detect division by zero step by step in the Ursa programming language
You may also check:How to resolve the algorithm Map range step by step in the J programming language
You may also check:How to resolve the algorithm String case step by step in the Julia programming language
You may also check:How to resolve the algorithm Documentation step by step in the Eiffel programming language