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 email@example.com. 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.
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.
- Count Possible Decodings of a given Digit Sequence
- Look-and-Say Sequence
- Farey Sequence
- Find Recurring Sequence in a Fraction
- Find maximum length Snake sequence
- Construction of Longest Increasing Subsequence(LIS) and printing LIS sequence
- G-Fact 21 | Collatz Sequence
- Complete the sequence generated by a polynomial
- Juggler Sequence
- Aliquot Sequence
- Maximum sum Bi-tonic Sub-sequence
- Recaman's sequence
- Largest sum Zigzag sequence in a matrix
- Minimum number of deletions to make a sorted sequence
- Thue-Morse sequence
- Sum of the sequence 2, 22, 222, .........
- Sylvester's sequence
- Golomb sequence
- Find longest bitonic sequence such that increasing and decreasing parts are from two different arrays
- Digit - Product - Sequence