subject
Mathematics, 02.10.2020 15:01 tanabugg

Can some one help me with this? I don't understand: The Fibonacci numbers are the numbers
\[
1,1,2,3,5,8,13,21,34\ldots
\]
where the first two numbers are 1 and 1, and each number after that is the sum of the two previous numbers. (So $2 = 1+1$, $3 = 2+1$, and so on.)

Write an algorithm, in English, that takes a positive integer $n$ as input and then outputs the $n$th Fibonacci number. For example, if we input to the algorithm $n=2,$ your algorithm should output 1. If we input $n=6,$ your algorithm should output 8.

Remember that an algorithm should consist of a series of unambiguous steps. Use variable names to identify what values you are referring to. You can assume that the computer can do basic arithmetic.

Above, we have given two input-output examples. Be sure to test your algorithm to see if it can successfully reproduce these examples and any others you care to test.
Thanks!

ansver
Answers: 3

Another question on Mathematics

question
Mathematics, 21.06.2019 14:30
Cass decided to sell game programs for the hockey game. the printing cost was over 20 cents per program with a selling price of 50 cents each. cass sold all but 50 of the programs, and made a profit of $65. how many programs were printed? letting p represent the number of programs printed, set up an equation that describes this situation. then solve your equation for p.
Answers: 1
question
Mathematics, 21.06.2019 16:40
The sum of two numbers is 86, and their difference is 20. find the two numbers
Answers: 2
question
Mathematics, 21.06.2019 16:50
Which is a true statement comparing the graphs of x^2/6^2-y^2/8^2 = 1 and x^2/8^2-y^2/6^2 the foci of both graphs are the same points. the lengths of both transverse axes are the same. the directrices of = 1 are horizontal while the directrices of = 1 are vertical. the vertices of = 1 are on the y-axis while the vertices of = 1 are on the x-axis.
Answers: 2
question
Mathematics, 21.06.2019 18:00
Me, the vertices of quadrilateral coat are c(2,0), o(7,0), a(7,2) and t(2,2). prove that coat is a rectangle.
Answers: 3
You know the right answer?
Can some one help me with this? I don't understand: The Fibonacci numbers are the numbers
\[<...
Questions
question
Mathematics, 02.03.2021 22:10
question
Physics, 02.03.2021 22:10
question
Mathematics, 02.03.2021 22:10
question
Social Studies, 02.03.2021 22:10
question
English, 02.03.2021 22:10
question
Mathematics, 02.03.2021 22:10
Questions on the website: 13722362