Given the value of n(n < 10), i.e, number of lines, print the Fibonacci triangle.
Input : n = 5 Output : 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 Input : n = 7 Output : 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811
The Fibonacci numbers are the numbers in the following integer sequence.
1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ……..
In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the recurrence relation
Fn = Fn-1 + Fn-2
with seed values F1 = 1 and F2 = 1.
Below is the implementation of the above pattern :
1 1 2 3 5 8 13 21 34 55 89 144 233 377 610
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Program to print a Hollow Triangle inside a Triangle
- Check if a M-th fibonacci number divides N-th fibonacci number
- Check if sum of Fibonacci elements in an Array is a Fibonacci number or not
- Sum of numbers in the Kth level of a Fibonacci triangle
- Biggest Reuleaux Triangle within a Square which is inscribed within a Right angle Triangle
- Biggest Reuleaux Triangle inscribed within a Square inscribed in an equilateral triangle
- C++ Program to print Fibonacci Series using Class template
- C Program to print Fibonacci Series without using loop
- Program to print first n Fibonacci Numbers | Set 1
- C Program to print Floyd's triangle
- Program to print modified Binary triangle pattern
- Print Fibonacci Series in reverse order
- Print first n Fibonacci Numbers using direct formula
- Print Fibonacci sequence using 2 variables
- 3 Different ways to print Fibonacci series in Java
- C Program for Fibonacci numbers
- Time complexity of recursive Fibonacci program
- Program to find last two digits of Nth Fibonacci number
- Program to find Nth odd Fibonacci Number
- C/C++ Program for nth multiple of a number in Fibonacci Series
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.
Improved By : manishshaw1