subject
Mathematics, 24.02.2020 21:29 rileyeddins1010

The Fibonacci series: 0, 1, 1, 2, 3, 5, 8, 13, 21, has as its first 2 values, 0 and 1; each successive value if then calculated as the sum of the previous two values. The first element in the series is the 0'th element, thus the value 8 is element 6 of the series. The n'th element of the series, written as fib(n), is thus defined as:
n if n = 0 or n = 1
fib(n-1) + fib(n-2)

Write the int -valued function fib, that takes a single int parameter (say n), and recursively calculates and then returns the n'th element of the Fibonacci series.

ansver
Answers: 2

Another question on Mathematics

question
Mathematics, 21.06.2019 16:30
An automated water dispenser fills packets with one liter of water on average, with a standard deviation of 5 milliliter. the manual says that after a year of operation the dispenser should be tested to see if it needs recalibration. a year later a number of filled packets are set aside and measured separately. it is found that the average packet now contains about 0.995 liters. does the dispenser need calibration? explain your answer.
Answers: 2
question
Mathematics, 21.06.2019 17:00
The perimeter of a stage is 116 feet. it is 17 feet wide. how long is it?
Answers: 1
question
Mathematics, 21.06.2019 17:40
The graph of h(x)= |x-10| +6 is shown. on which interval is this graph increasing
Answers: 2
question
Mathematics, 22.06.2019 00:00
Find the percent cost of the total spent on each equipment $36, fees $158, transportation $59 a. 14%, 62%, 23% b. 15%, 60%, 35% c. 10%, 70%, 20% d. 11%, 62%, 27%
Answers: 3
You know the right answer?
The Fibonacci series: 0, 1, 1, 2, 3, 5, 8, 13, 21, has as its first 2 values, 0 and 1; each successi...
Questions
question
Biology, 08.12.2020 14:20
question
Mathematics, 08.12.2020 14:20
question
English, 08.12.2020 14:30
question
Mathematics, 08.12.2020 14:30
Questions on the website: 13722363