Problem 55990. Next Tribonacci Number
The "Tribonacci" sequence is an extension of the idea of the Fibonacci sequence:
That is, each new term is the sum of the three previous terms.
The first 10 Tribonacci numbers are: 0, 1, 1, 2, 4, 7, 13, 24, 44, 81.
Given a value N, find the smallest Tribonacci number greater than N. You can assume N is a positive integer.
For example, if N = 42, your function should return 44. If N = 17, your function should return 24.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers129
Suggested Problems
-
3382 Solvers
-
Set the array elements whose value is 13 to 0
1381 Solvers
-
Create a vector whose elements depend on the previous element
714 Solvers
-
590 Solvers
-
151 Solvers
More from this Author12
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!