Enter a number to check if it belongs to the Perrin sequence, or input N to calculate the Nth term and the cumulative sum.
The Perrin sequence is a series of integers defined by the following rules:
The Perrin sequence shares the same recurrence relation as the Padovan sequence but starts with different initial values. The sequence begins as follows: 3, 0, 2, 3, 2, 5, 7, 12, 19, 31, and so on.
Solution:
Generate the sequence:
\( P(0) = 3 \)
\( P(1) = 0 \)
\( P(2) = 2 \)
\( P(3) = P(1) + P(0) = 0 + 3 = 3 \)
\( P(4) = P(2) + P(1) = 2 + 0 = 2 \)
\( P(5) = P(3) + P(2) = 3 + 2 = 5 \)
Result:
Since \( P(5) = 5 \), the number 5 belongs to the Perrin sequence.
Solution:
Generate the sequence:
\( P(0) = 3 \)
\( P(1) = 0 \)
\( P(2) = 2 \)
\( P(3) = P(1) + P(0) = 0 + 3 = 3 \)
\( P(4) = P(2) + P(1) = 2 + 0 = 2 \)
\( P(5) = P(3) + P(2) = 3 + 2 = 5 \)
…
\( P(15) = P(13) + P(12) = 39 + 29 = 68 \)
\( P(16) = P(14) + P(13) = 51 + 39 = 90 \)
\( P(17) = P(15) + P(14) = 68 + 51 = 119 \)
Result:
The number 119 belongs to the Perrin sequence.
Solution:
Generate the sequence:
\( P(0) = 3 \)
\( P(1) = 0 \)
\( P(2) = 2 \)
\( P(3) = P(1) + P(0) = 0 + 3 = 3 \)
\( P(4) = P(2) + P(1) = 2 + 0 = 2 \)
\( P(5) = P(3) + P(2) = 3 + 2 = 5 \)
…
\( P(26) = P(24) + P(23) = 853 + 644 = 1497 \)
\( P(27) = P(25) + P(24) = 1130 + 853 = 1983 \)
\( P(28) = P(26) + P(25) = 1497 + 1130 = 2627 \)
Result:
\( P(28) = 2627 > 2025 \). So, the number 2025 does not belong to the Perrin sequence.