Given a number n, calculate the corresponding Tribonacci number. The Tribonacci sequence TnT_nTn is defined as:
n