Fibonacci Numbers Algorithm

In mathematics, the Fibonacci number sequence is defined recursively as follows:

Explanation: This line starts from 0 and 1, then the next number obtained by adding the previous two numbers in sequence. With this rule, the sequence number of the first Fibonaccci are:

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10 946 …

Rows of Fibonacci numbers can be expressed as follows:

Fn = (x1n – x2n)/ sqrt(5)

with

Fn is the nth Fibonacci for n
x1 and x2  is a solution to the equation x2-x-1=0

Comparison between the  Fn+1 with the Fn is almost always the same for any value of n and n values from a particular, a comparison of this value is fixed. Comparison is called the Golden Ratio is the value close to 1.618.

RAPTOR Using Fibonacci Numbers:

This is subchart :


Here is a sample C + + :

#include <iostream>
#include <string>
 
using namespace std;
int main()
{
   string raptor_prompt_variable_zzyz;
   int n;
   int f3;
   int f2;
   int f1;
   char* result;
 
   f1 =0;
   f2 =1;
   raptor_prompt_variable_zzyz =”Enter the number of constraints: “;
   cout << raptor_prompt_variable_zzyz << endl;
   cin >> n;
   cout << f1 << ” ” << f2 << ” “;
   while (!(f3>=n))
   {
      f3 =f2+f1;
      f1 =f2;
      f2 =f3;
      if (f3<n)
      {
         cout << f3 << ” “;
      }
      else
      {
      }
   }
   return 0;
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s