Fibonacci? No, It is Tribonacci!

Let \[ f(n) = \left\{ \begin{array}{l l} 4 - n & \quad \text{if $n$} \leq 3\\ f(n-1)+f(n-2)+f(n-3) & \quad \text{if $n$} > 3 \end{array} \right.\]

What are the last 3 digits of \(f(10^{12})\)?

Image credit : Rauzy Fractal
×

Problem Loading...

Note Loading...

Set Loading...