answersLogoWhite

0


Best Answer

This Perl script should answer your question for any index in the Fibonacci sequence. (until it overflows a variable) sub fib { print "Enter a number: "; chomp($n = ); $x = 1; $y = 1; $ans = 0; $i = $n; while ($i > 0) { $ans = $y; $y = $x; $x += $ans; $i--; } print "\nThe Fibonacci number at index $n is $ans\n"; } &fib; Enter a number: 22 The Fibonacci number at index 22 is 17711 here are the first 20, just add 19 and 20 and you get 21 and add 20 and 21 and you get 22 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765 . .

User Avatar

Wiki User

βˆ™ 15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is 22 Fibonacci number?
Write your answer...
Submit
Still have questions?
magnify glass
imp