Let D[n] be a sequence whose values are recursively related by D[n] = D[n-2] - D[n-1].
D[1] is fixed to be equal to 1. Most choices of D[2] will result in a sequence which eventually has some n such that D[n] is negative.
What is the set of values for D[2] exist such that all terms of D[n] are positive?
delta=.0000001;
for d2=0.61802:delta:0.61804
a=1;b=d2;
for step=3:100
c=a-b;
if c<0 || step ==100
disp([d2 step c])
break
end
a=b;b=c;
end
end
is the final narrowing in of where the result is locaated. As you can see the narrowing has brought it in to bracket phi - 1, which is the same as 1/phi.
The narrowing was done by looking for the least absolute value among the output data, which were all negaative, among the longest number of steps to get to the negative value.
Then using only 1/phi with the following replacement line:
for d2=2/(1+sqrt(5))
it took 42 steps to get to a negative value, which can be attributed to rounding error.
The sequence:
1, phi-1, 2-phi, 2*phi-3, 5-3*phi, -8+5*phi, ...
where each term (i, starting at 1) is (-1)^(i-1) * (F(i)-F(i-1)*phi)
|
Posted by Charlie
on 2023-02-15 17:13:49 |