赛派号

洗地机哪个牌子最好用又便宜耐用的 Fibonacci Calculator

With the Fibonacci calculator you can generate a list of Fibonacci numbers from start and end values of n. You can also calculate a single number in the Fibonacci Sequence, Fn, for any value of n up to n = ±500.

Fibonacci Sequence

The Fibonacci Sequence is a set of numbers such that each number in the sequence is the sum of the two numbers that immediatly preceed it.

\[ F_{0} = 0,\quad F_{1} = F_{2} = 1, \]

and

\[ F_{n}=F_{n-1}+F_{n-2} \]

For example, calculating F4

\[ F_{4}=F_{4-1}+F_{4-2} \] \[ F_{4}=F_{3}+F_{2} \] \[ F_{4}=2+1 \] \[ F_{4}=3 \]

The first 15 numbers in the sequence, from F0 to F14, are

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377

Fibonacci Sequence Formula

The formula for the Fibonacci Sequence to calculate a single Fibonacci Number is:

\[ F_{n}={\dfrac{(1+\sqrt{5})^{n}-(1-\sqrt{5})^{n}}{2^{n}\sqrt{5}}} \]

or

Fn = ( (1 + √5)^n - (1 - √5)^n ) / (2^n × √5)

for positive and negative integers n.

A simplified equation to calculate a Fibonacci Number for only positive integers of n is:

\[ F_{n}=\left[{\dfrac{(1+\sqrt{5})^{n}}{2^{n}\sqrt{5}}}\right] \]

or

Fn = [( (1 + √5)^n ) / (2^n × √5)]

where the brackets in [x] represent the nearest integer function. Simply put, this means to round up or down to the closest integer.

A more compact version of the formula used is:

\[ F_{n} = \dfrac{ \phi^{n} - \psi^{n} }{ \sqrt{5}} \]

or

Fn = ( φ^n - ψ^n ) / √5

where φ, the Greek letter phi, is the Golden Ratio φ = (1 + √5) / 2 ≈ 1.618034... and ψ, the Greek letter psi, is ψ = (1 - √5) / 2 ≈ -0.618034...

Since it can be shown that ψ^n is small and gets even smaller as n gets larger, when only working with positive integers of n, the compact Fibonacci Number formula is true:

\[ F_{n} = \left[ \dfrac{\phi^n}{\sqrt{5}} \right] = \left[ {\dfrac{(1+\sqrt{5})^{n}}{2^{n}\sqrt{5}}}\right]\]

where the brackets in [x] represent the nearest integer function as defined above.

Negative Fibonacci Numbers

Unless stated otherwise, formulas above will hold for negative values of n however, it could be easier to find Fn and solve for F-n using the following equation.

\[ F_{-n}=(-1)^{n+1}F_{n} \]

Putting it another way, when -n is odd, F-n = Fn and when -n is even, F-n = -Fn.

If you are generating a sequence of -n by hand and working toward negative infinity, you can restate the sequence equation above and use this as a starting point:

\[ F_{0} = 0,\quad F_{1} = F_{2} = 1, \]

and

\[ F_{n}=F_{n+2}-F_{n+1} \]

For example with n = -4 and referencing the table below

\[ F_{-4}=F_{-4+2}-F_{-4+1} \] \[ F_{-4}=F_{-2}-F_{-3} \] \[ F_{-4}=-1-2 \] \[ F_{-4}=-3 \] F-9 to F9 F-9  to  F9

n Fn -9 34 -8 -21 -7 13 -6 -8 -5 5 -4 -3 -3 2 -2 -1 -1 1 0 0 1 1 2 1 3 2 4 3 5 5 6 8 7 13 8 21 9 34 References

Knuth, D. E., The Art of Computer Programming. Volume I. Fundamental Algorithms, Addison-Wesley, 1997, Boston, Massachusetts. pages 79-86

Chandra, Prin and Weisstein, Eric W. "Fibonacci Number." From MathWorld--A Wolfram Web Resource. https://mathworld.wolfram.com/FibonacciNumber.html

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至lsinopec@gmail.com举报,一经查实,本站将立刻删除。

上一篇 没有了

下一篇没有了