Remember the Fibonacci series:
a(k+1)=a(k)+a(k−1) ∀k>2, a(0)=1,a(1)=1 (2)
Interestingly the golden ratio can be calculated from the this series:
— Write a script that calculates the golden ratio from the Nth and (N − 1)th Fibonacci numbers.
my code look like this but it didnt work. Can someone help me? Thank you!
a(1) = 1;
a(2) = 1;
n=3
while n <= 16 %the value for this can be changed
a(n) = a(n-1)+a(n-2);
ratio = limit(a(n)/a(n-1),n,inf);
n=n+1;
end
Best Answer