A trinomial coefficient is a coefficient of the trinomial triangle. Following the notation of Andrews, the trinomial coefficient (n k)_2, with n>=0 and -n<=k<=n, is given by the coefficient of x^(n + k) in the expansion of (1 + x + x^2)^n. Therefore, (n -k)_2 = (n k)_2. The trinomial coefficient can be given by the closed form (n k)_2 = {1 | for n = k = 0 C_(k + n)^(-n)(-1/2) | otherwise, auto right match where C_n^(λ)(z) is a Gegenbauer polynomial.