Generating Lucas numbers

The Lucas numbers L1,L2,... are defined by L1=1, L2=3 and Lm=Lm-1+Lm-2 for m ≥ 3.
Lm=(αmm)/√5, where α=(1+√5)/2 and β=(1-√5)/2.
If m and n are positive integers, m ≤ n, not greater than 10000, the Lucas numbers Lm,...,Ln are printed.

Enter m (1 ≤ m ≤ 1010 ):
Enter n (m ≤ n ≤ 1010 ):

Last modified 3rd January 2012
Return to main page