Given here are two positive numbers a and b. The task is to print the least common multiple of a’th and b’th Fibonacci Numbers.
The first few Fibonacci Numbers are 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ……
Note that 0 is considered as 0’th Fibonacci Number.
Input : a = 3, b = 12 Output : 144 Input : a = 8, b = 37 Output : 507314157
Approach: The simple solution of the problem is,
- Find the a’th fibonacci number.
- Find the b’th fibonacci number.
- Find their GCD, and with the help of the GCD find their LCM. The relation is LCM(a, b) = (a x b) / GCD(a, b) (Please refer here).
Below is the implementation of the above approach:
- Sum of LCM(1, n), LCM(2, n), LCM(3, n), ... , LCM(n, n)
- Program to find last digit of n'th Fibonnaci Number
- Prime Fibonnaci | TCS Mockvita 2020
- Program to find LCM of two numbers
- Program to find the LCM of two prime numbers
- Minimum replacement of pairs by their LCM required to reduce given array to its LCM
- Find two numbers with the given LCM and minimum possible difference
- Find two numbers with given sum and maximum possible LCM
- Find two distinct numbers such that their LCM lies in given range
- Program to find LCM of 2 numbers without using GCD
- Finding LCM of more than two (or array) numbers without using GCD
- LCM of two large numbers
- Maximum sum of distinct numbers such that LCM of these numbers is N
- Find LCM of rational numbers
- LCM of First n Natural Numbers
- Maximum sum of distinct numbers with LCM as N
- LCM of N numbers modulo M
- Maximum LCM among all pairs (i, j) of first N natural numbers
- Highest power of 2 that divides the LCM of first N Natural numbers.
- Print numbers such that no two consecutive numbers are co-prime and every three consecutive numbers are co-prime
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.