A sequence starts with 0, 1, 1 (terms number 0, 1 and 2). Every later term is the sum of the three terms before it: 0, 1, 1, 2, 4, 7, 13, …
Given position, return the term with that number.
Example 1
position=5 → 7
The sequence goes 0, 1, 1, 2, 4, 7. Term number 5 is 7 = 1 + 2 + 4.
Example 2
position=1 → 1
The first three terms are given: term number 1 is 1.