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.

  1. Track three values: a=0, b=0, c=1.
  2. Use a loop to print precisely count numbers.
  3. Advance the sequence by summing all three and shifting the "window" forward.

01EXAMPLE 1

Inputcount=5
Output0 0 1 1 2

Explanation: Sums 0+0+1=1, then 0+1+1=2.

Constraints

  • Use a single loop.
  • Print each result on a new line.
LoopsMath
JavaScript
Loading...
3 Hidden

Input Arguments

count5

Expected Output

0
0
1
1
2

Click RUN to test your solution