Édouard Lucas (1842 – 1891) is known for improving and expanding the Fibonacci series. Lucas worked in the Paris observatory and later became a professor of mathematics in Paris. Similar to the Fibonacci, the ratio between two consecutive Lucas numbers converges to the golden ratio. Lucas numbers appear in nature often enough to prove that they reflect some naturally occurring patterns.

Try following example at compilejava.net

public class Lucas {

   public static void main(String args[]) {
      int x,y,z,max; //Declare four integers
      x=2;
      y=1;
      max=10000;

      while( max > x ) {
         System.out.print(x+", ");
         z=x+y;
         x=y;
         y=z;
      }
   }
}

Lucas numbers (beginning at 2): L(n) = L(n-1) + L(n-2).

2, 1, 3, 4, 7, 11, 18, 29, 47, 76, 123, 199, 322, 521, 
843, 1364, 2207, 3571, 5778, 9349, 15127, 24476, 39603, 
64079, 103682, 167761, 271443, 439204, 710647...

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