id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

simona1@sfusd.edu > tribonacci
prev  |  next  |  chance

The first three tribonacci numbers are 1, 1, and 2. The fourth is 4, which is the sum of the first three. Each successive tribonacci number is the sum of the previous three tribonacci numbers. The tribonacci numbers are 1, 1, 2, 4, 7, 13, 24, 44, 81, 149, 274, 504, 927, 1705, 3136, 5768, 10609, 19513, 35890 and so on.


tribonacci(0) → 1
tribonacci(1) → 1
tribonacci(2) → 2

...Save, Compile, Run (ctrl-enter)

def tribonacci(n):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Post-solution available

Copyright Nick Parlante 2017 - privacy