about | help | code help+videos | done | prefs |
Write a RECURSIVE method that returns the "triple Fibonacci number" which is similar to normal Fibonacci numbers except that the number is based on the sum of the previous THREE numbers. The first two triple Fibonacci numbers are both zero and the third number is 1. After that, each successive number is found by adding the previous three numbers together. Starting with tripFibbNum(1) the values are 0, 0, 1, 1, 2, 4, 7, 13, 24, 44, 81, etc. You MUST solve this problem using RECURSION in order to get credit for it. Note that your program does NOT have to work for large values of 'num' since it could easily cause a stack overflow due to the recursion. feb_22_2019_APSLHL_tripleFibb(1) → 0 feb_22_2019_APSLHL_tripleFibb(2) → 0 feb_22_2019_APSLHL_tripleFibb(3) → 1 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 390
Copyright Nick Parlante 2017 - privacy