Nth Tribonacci Number
Given a number n, calculate the corresponding Tribonacci number.
We'll cover the following...
Statement
Given a number , calculate the corresponding Tribonacci number. The Tribonacci sequence is defined as:
, and for |
---|
Constraints
The input number, , is a non-negative integer.
Example
Sample input
4
Expected output
4
Try it yourself
Access this course and 1400+ top-rated courses and projects.