Fibonacci Ratio Sequences

Define a sequence recursively by v[n] = (v[n-3] + v[n-2]) / v[n-1] and the three initial values v[0], v[1], v[2].

The graph (n, v[n]) looks like a bunch of overlapping sine curves, each not formed by connecting consecutive points, but by selecting certain non-consecutive points.

My algorithm for finding these smooth curves is as follows: Start with 4 points on a curve, then there is an unique cubic function passing through the 4 points. Find the point closest to the cubic within a window of say 50 steps. We restrict to a window since we're approximating the curve locally by a cubic, and the approximation gets worse as you go farther away. We use a cubic because it has an inflection point, which a sine curve has. Then we advance to the next 4 points including the one we just chose, and repeat. We extend the curve first in the positive direction, then we have plenty of points to extend it in the negative direction.

But how do we start with one point? One point determines a horizontal line, and we can find the closest point to the line within the window. Then we have 2 points which determines a line. Adding the closest point to the line within the window and we get a quadratic. Adding the closest point to the quadratic within the window and we get a cubic. Thus it's best to choose the initial point at a local extremum.

If we instead select the nearest point, without comparing with a curve from previous points, then we are more likely to end up on the wrong curve when they cross.

Flash 9 or above required.

The grid are powers of 10 and scales automatically to fit in the window; the actual position of the mouse pointer is shown.

The parameters at the top can be changed with the Update button.

Click to attempt to color a smooth curve at the nearest point. Shift/Ctrl/Alt-click to add more points for the initial approximating.

The Backspace removes the latest approximation point. It can remove a whole curve, including the initial curve, which is drawn at n = 3, the first generated point.

The Update button removes all the curves and resets to the one initial curve.

Press C to copy the settings and the absolute and relative indices of each smooth curve. Restoring settings via paste does not work.

There are no other controls. In particular, you're stuck with the sequence of colors from 0.618-steps of hue starting with red.


Empirically, each of these smooth curves consists of every 26 indices, so here's an applet to connect points for every v indices and varies one of the initial values.

The y scale is now fixed and can be set by specifying the maximum.

The Update button resets the varying initial value to the minimum, but zero is excluded as that leads to dividing by zero.

Click on the label for one of the initial values to select the one to vary. That does an implicit update of everything.

Press C to copy the settings. Restoring settings via paste does not work.

Flash 9 or above required.

Open questions:

And so on....

Colophon: written directly in HTML 4 and ActionScript 3 for Flash 10. Source code: Applet 1 and Applet 2.


Copyright © 2013 Di-an Jan. All rights reserved.