How to find the nth term of tribonacci series [duplicate]

I want to know the nth term of tibonacci series, given by the recurrence relation $$ a_{n + 3} = a_{n + 2} + a_{n + 1} + a_n $$ with $a_1 = 1, a_2 = 2, a_3 = 4$, so the first few terms are $$ 1,2,4,7,13,24,44, \ldots $$ I am more interested in derivation of how the nth term is calculated rather than direct comming up with black box formula.


Solution 1:

The $n^{th}$ tribonacci number $T_n$ is given by the closest integer to $$\frac{3 b}{b^2-2 b+4} \Big(\frac{a_++a_-+1}{3}\Big)^n $$ where $$a_{\pm}=\sqrt[3]{19 \pm 3 \sqrt{33}}$$ $$b=\sqrt[3]{586 + 102 \sqrt{33}}$$

You could find all required information in the links the comments and answers refer to.

Solution 2:

See OEIS sequence A000073. We can write $$a_n = \sum_r \frac { -4\,{r}^{2}-3\,r+5}{ 22\;{r}^{n+3}}$$ where the sum is over the three roots of $r^3 + r^2 + r - 1$ (one real and two complex).