Question
Tribonacci numbers are like Fibonacci numbers, except they have three starting terms that are predetermined and each subsequent term is the sum of the three
Tribonacci numbers are like Fibonacci numbers, except they have three starting terms that are predetermined and each subsequent term is the sum of the three preceding terms.
The first three terms are 0, 0, and 1. You should manually define these before the for loop.
The first 10 Tribonacci numbers are: 0, 0, 1, 1, 2, 4, 7, 13, 24, and 44 for your reference.
The Reciprocal Tribonacci sequence is the inverse of each Tribonacci number, starting with the third number (as the first two are zeros). You should manually define the first Reciprocal Tribonacci number (1) before the for loop.
The first 8 Reciprocal Tribonacci numbers are: 1, 1, 1/2, 1/4, 1/7, 1/13, 1/24, and 1/44 for your reference.
Write a program in correct Matlab syntax using a for loop that will create the first 15 elements of the Tribonacci number sequence and the corresponding first 13 Reciprocal Tribonacci numbers as two different vectors. Do not enter the values explicitly for the Tribonacci numbers (except for the first three) or the Reciprocal Tribonacci numbers (except for the first one), have the program compute each one (starting with the 4th Tribonacci number and the 2nd Reciprocal Tribonacci number). Display the entire Reciprocal Tribonacci number vector after the loop executes, not inside of the loop. Explicitly define the number of terms in your code. There should not be any user input in your code for this problem.
You must use the Trib variable to define the first 15 elements of the Tribonacci sequence and the Recip_Trib variable to define the corresponding first 13 terms of the Reciprocal Tribonacci sequence.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started