Padovan Sequence similar to Fibonacci sequence with similar recursive structure. The recursive formula is,
P(n) = P(n-2) + P(n-3) P(0) = P(1) = P(2) = 1
Fibonacci Sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55……
Spiral of squares with side lengths which follow the Fibonacci sequence.
Padovan Sequence: 1, 1, 1, 2, 2, 3, 4, 5, 7, 9, 12, 16, 21, 28, 37,…..
Spiral of equilateral triangles with side lengths which follow the Padovan sequence.
For Padovan Sequence: P0 = P1 = P2 = 1 , P(7) = P(5) + P(4) = P(3) + P(2) + P(2) + P(1) = P(2) + P(1) + 1 + 1 + 1 = 1 + 1 + 1 + 1 + 1 = 5
This article is contributed by Shivam Pradhan(anuj_charm). 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 write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Sum of the sequence 2, 22, 222, .........
- Look-and-Say Sequence
- Alcuin's Sequence
- Golomb Sequence | Set 2
- k-th number in the Odd-Even sequence
- Beatty sequence
- Connell Sequence
- Aronson's Sequence
- Gould's Sequence
- Increasing sequence with given GCD
- Juggler Sequence
- Aliquot Sequence
- Find F(n) when F(i) and F(j) of a sequence are given
- Farey Sequence
- Gijswijt's Sequence
- Recaman's sequence
- Golomb sequence
- Sylvester's sequence
- Program to find sum of the given sequence
- Sum of first N terms of Quadratic Sequence 3 + 7 + 13 + ...