How to resolve the algorithm Hofstadter-Conway $10,000 sequence step by step in the PL/I programming language
How to resolve the algorithm Hofstadter-Conway $10,000 sequence step by step in the PL/I programming language
Table of Contents
Problem Statement
The definition of the sequence is colloquially described as: Note that indexing for the description above starts from alternately the left and right ends of the list and starts from an index of one. A less wordy description of the sequence is: The sequence begins: Interesting features of the sequence are that:
The sequence is so named because John Conway offered a prize of $10,000 to the first person who could find the first position, p in the sequence where It was later found that Hofstadter had also done prior work on the sequence. The 'prize' was won quite quickly by Dr. Colin L. Mallows who proved the properties of the sequence and allowed him to find the value of n (which is much smaller than the 3,173,375,556 quoted in the NYT article).
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Hofstadter-Conway $10,000 sequence step by step in the PL/I programming language
Source code in the pl/i programming language
/* First part: */
declare L (10000) fixed static initial ((1000) 0);
L(1), L(2) = 1;
do i = 3 to 10000;
k = L(i);
L(i) = L(i-k) + L(1+k);
end;
You may also check:How to resolve the algorithm Runtime evaluation/In an environment step by step in the Phix programming language
You may also check:How to resolve the algorithm Empty program step by step in the Peri programming language
You may also check:How to resolve the algorithm Sockets step by step in the AutoIt programming language
You may also check:How to resolve the algorithm Loops/Break step by step in the VBScript programming language
You may also check:How to resolve the algorithm Sum and product puzzle step by step in the Factor programming language