The repeat you configured is as follows:
T (n) = T (n - 1) + T (n - 2) + T (n - 3)
I guess the base cases are probably
T (0) = T (1) = T (2) = 1
If you begin to expand the conditions of this repetition, you get
- T (0) = 1
- T (1) = 1
- T (2) = 1
- T (3) = 3
- T (4) = 5
- T (5) = 9
- T (6) = 17
- T (7) = 31
- ...
There seems to be no obvious picture here. Fortunately, we can go to the Online Encyclopedia of Integer Sequences and perforate in terms of 1, 1, 1, 3, 5, 9, 17, and you will find that this is a tribonacci sequence , the first three conditions of which are equal to 1.
If you look at the information on the Tribonacci numbers, you will see the following:
a (n) / a (n-1) tends to the tribonacci constant, 1.839286755 ...
(here (n) is the designation that the site uses for my T (n)). Since the ratio of consecutive members of the Tribonacci sequence tends to be approximately 1.839286755, we know that the Tribonacci sequence should increase exponentially, and it grows exponentially at a rate that is approximately equal to & Theta (1.839286755 n ). (Compare this to the Fibonacci sequence, which is known to grow in? Theta; (? Phis; n ), where? Is the golden ratio). Further reading of Wikipedia gives this formula for the Tribonacci constant:

and confirms the exponential growth rate.
Therefore, we can conclude that the lead time is: & theta; (1.839286755 n ).
So ... how would you calculate this yourself? The easiest way to do this (and I think these values ββare known) is to use function generation . You can try to get a generating function for the repetition you are repeating, and then try to overwrite the generation function in a closed form to get the exact value. This is one way to get a closed form for Fibonacci numbers, and it should be generalized here (although it can be a lot of traffic jams through unpleasant mathematics). Alternatively, as @tmyklebu points out, you can write this matrix:
| 0 1 0 | M = | 0 0 1 | | 1 1 1 |
and calculate its eigenvalues, the largest of which will go to the Tribonacci constant. (Note that this matrix has the property that
| 0 1 0 | |a| | b | | 0 0 1 | x |b| = | c | | 1 1 1 | |c| |a + b + c|
Therefore, if you put three consecutive values ββfrom a repetition into a column vector v and calculate Mv, you return a new column vector that keeps the last two values ββfrom repeating, plus the next value in the repetition. Thus, you can calculate the kth repetition value by calculating M k v and looking at the first component of the vector.)
Hope this helps!