TeX source:
 \begin{array}{l|lllllll} x & 0 & 1 & 2 & 3 & 4 \\ \hline f & 3 & 6 & 6 & 3 & 1 \end{array}