The Tribonacci Pulse
MediumAcc. 91.8%
+25 XP 10
Triple Integration
The Tribonacci sequence starts with 0, 0, 1. Each number is the sum of the three previous numbers: 0, 0, 1, 1, 2, 4, 7, 13...
The Assignment
Your function receives a parameter count.
- Track three values:
a=0,b=0,c=1. - Use a loop to print precisely
countnumbers. - Advance the sequence by summing all three and shifting the "window" forward.
01EXAMPLE 1
Input
count=5Output
0
0
1
1
2Explanation: Sums 0+0+1=1, then 0+1+1=2.
Constraints
- Use a single loop.
- Print each result on a new line.
LoopsMath
JavaScriptSystem handles I/O — write your function only
Loading...
3 Hidden
Input Arguments
count5
Expected Output
0 0 1 1 2
Click RUN to test your solution