There is no idea to solve the question for me.
Let $T\subset\mathbb N_{>0}$ be a finite set of positive integers. For each integer $n>0$, define $a_n$ to be the number of all finite sequences $(t_1,t_2,...,t_m)$ with $m\leq n$, $t_i\in T$ for all $i=1,...,m$ and $t_1+...+t_m=n$. Prove that the infinite series $$1+\sum_{n\geq 1}a_nz^n\in\mathbb C[[z]]$$ is a rational function in $z$, and find this rational function.
The definition of series is strange. Can someone help me? Thank you.