Question: Triponacci is a series where the nth value is equal to the sum of the previous 3 values. The initial 3 values (base values) of

Triponacci is a series where the nth value is equal to the sum of the previous 3 values. The initial 3 values (base values) of our series are {0, 1, 2}

Note that the very first value in our series is 0th value.

Input Format

Input n will be a single integer java value

Constraints

n will be a non-negative value less than 100.

Output Format

Output will be in the form of a statement: Triponacci(2) = 2 The value in the parenthesis is the input value n. The number to the right of the equals sign is the value of the nth element of the series.

Triponacci(0) = 0 Triponacci(3) = 3

Sample Input 0

3 

Sample Output 0

Triponacci(3) = 3 

Explanation 0

Triponacci(3) = Triponacci(2) + Triponacci(1) + Triponacci(0) Triponacci(3) = 2 + 1 + 0 = 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!