Question: The coefficients of how many terms in the expansion of (1+x)2018 are multiples of 13?
So, we've to investigate the powers of 13 in ${2018 \choose r}$, where 0 ≤ r ≤ 2018
I tried using the following: $$s_p(N!) = \left \lfloor \frac{N}{p} \right \rfloor + \left \lfloor \frac{N}{p^2} \right \rfloor + \left \lfloor \frac{N}{p^3} \right \rfloor + \cdots$$
where, $s_p(N!)$ denotes the highest exponent of prime p in n!, where n is a natural number.
${2018 \choose r}$, may be written as $\frac{2018!}{r!(2018-r)!}$. Now, I tried to figure out the exponent of 13 in numerator for several values of r, but couldn't find a pattern that would lead me to the desired answer.
Could someone please give a detailed solution to this problem, and also explain how to approach such problems? Is there any generalisation for the multiples of a prime number p in ${n \choose r}$?
P.S. The answer, to the best of my recollection, is 1395.