Mathematics
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!

answer
Answers: 3

Other questions on the subject: Mathematics

image
Mathematics, 21.06.2019 16:20, jaueuxsn
Tomas is making trail mix using granola and walnuts. he can spend a total of $12 on the ingredients. he buys 3 pounds of granola that costs $2.00 per pound. the walnuts cost $6 per pound. he uses the equation to represent the total cost, where x represents the number of pounds of granola and y represents the number of pounds of walnuts. he solves the equation for y, the number of pounds of walnuts he can buy. answer- b tomas added 6 to both sides of the equation instead of subtracting 6. just took the test
Answers: 1
image
Mathematics, 21.06.2019 17:00, burritomadness
If a baby uses 15 diapers in 2 days, how many diapers will the baby use in a year?
Answers: 2
image
Mathematics, 21.06.2019 19:00, 5001Je
X2 + y 2 = 36 x + y = 6 solve the system of equations.
Answers: 3
image
Mathematics, 21.06.2019 21:30, jerenasmith77
Are the corresponding angles congruent? explain why or why not.
Answers: 2
Do you know the correct answer?
Can some one help me with this? I don't understand: The Fibonacci numbers are the numbers
\[<...

Questions in other subjects:

Konu
Mathematics, 07.07.2019 02:00