📅  最后修改于: 2022-03-11 15:01:55.691000             🧑  作者: Mango
f(n) = f(n-1) + f(n-2)
f(6)
^
/\
f(5) + f(4)
^
/\ /\
f(4) + f(3) f(3) + f(2)
^ ^ ^ ^
/\ /\ /\ /\
f(3) + f(2) f(2) +f(1) f(2) + f(1) f(1) + f(0)
^ ^ ^ ^
/\ /\ /\ /\
f(2) + f(1) f(1) + f(0) f(1)+ f(0) f(1) + f(0)
^
/\
f(1) + f(0)
//f(6) = 8 ==> f(1)*8 f(1) appears 8 times
double feb = (1/Math.pow(5,0.5)) * (Math.pow((1+Math.pow(5,0.5))/2,n)) - (1/Math.pow(5,0.5))* (Math.pow((1-Math.pow(5,0.5))/2,n));
f(1) == 1;