Question: DEFINE: Write a program that loops through numbers 1-1000. Then, check which numbers are part of the Fibonacci sequence. Note that the Fibonacci sequence begins
DEFINE: Write a program that loops through numbers 1-1000. Then, check which numbers are part of the Fibonacci sequence. Note that the Fibonacci sequence begins with 0 and 1 , and then all following items in the sequence are the sum of the two previous items. For example, the first 6 numbers in the sequence are 0,1 , 1,2,3, and 5 . You should only print out numbers that are part of the Fibonacci sequence (do not print out all numbers). MEASURE: - Is a number part of the Fibonacci sequence? - Hint: One way to do this is to check these equations below where " n " is the number you are checking. If either of these results is a perfect square (the result of multiplying a number by itself), it is part of the sequence. (5n2+4)(5n24) ANALYZE: - How do you make a list of numbers that goes from 1 to 1000 ? (Indexing) - How do you check if a number is part of the Fibonacci sequence (see hint above) - How do you only print values that are part of the sequence
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
