Suppose $$ x(x+1)(x+2)\cdots(x+239)=\sum_{n=1}^{240}a_nx^n $$ What's the total number of $a_n$ which is exactly the multiple of $3$?
I've calculated using Mathematica and got the answer is $160$, but I don't know how to solve it using Number Theory. This is my Mathematica code:
Tr[Divisible[CoefficientList[Product[(x + i), {i, 1, 240}], x][[2 ;; 240]], 3]]
and get
80 False + 159 True
Hint. We have that $$\prod_{n=0}^{239}(x+n)\equiv \left(x(x+1)(x-1)\right)^{80}= x^{80}(x^2-1)^{80}=x^{80}\sum_{k=0}^{80}\binom{80}{k}(-x^{2})^k\pmod{3}.$$ So your answer is correct as soon as you show that $\binom{80}{k}$ is not a multiple of $3$ for all $k=0,1,\dots,80$. Note that $80=3^4-1=2\cdot 3^3+2\cdot 3^2+2\cdot 3^1+2\cdot 3^0$ and use Lucas's theorem.