A couple of weeks ago I came up with this function which could determine the number of coefficients divisible by some number $m$ in the binomial expansion of the expression $(x+y)^q$:
iff
$$p=\sum_{i=1}^{\lfloor\log(m,q)\rfloor}\left\lfloor\frac{q}{m^i}\right\rfloor-\left\lfloor\frac{j}{m^i}\right\rfloor-\left\lfloor\frac{q-j}{m^i}\right\rfloor$$ Then
$$\frac12\sum_{j=0}^{q}\left(\frac{|2p-1|}{2p-1}+1\right)=n\left(m|{q\choose j}\right)$$
I then graphed the first $10000$ results where $m=2$ which produced this lovely pattern:
Graph of function up to $q=10000$
My question is then if anyone has investigated this area before and could maybe shed some light on the trends occurring in the graph. Notice the almost fractal like structure and the lines, which look like log functions, throughout the graph. If anyone has a more efficient way of calculating these values or improving my formula I would also be very interested in that. The graph took me half an hour to evaluate in mathematica by the way if anyone wants to try graphing it themselves.
The limit of the percentage does not converge to $100\%$. However, it can get arbitrarily close to $100\%$. Let's denote the amount of numbers in the $n$th row of pascals triangle divisible by $m$ by the function $N_m(n)$. It is known that $\binom{2^n}{k}=0$ for $0< k< 2^n$ and with a little bit of reasoning we can also see that $\binom{2^n-1}{k}=1$ for $0\leq k\leq 2^n$. So, for any $M$, we can find an $x>M$ such that $N_2(M)=M-2$, but we can also find an $x>M$ with $N_2(M)=0$. Since we obtain the percentage by $100\cdot\frac{N_2(x)}{x}$, we see that we get $0\%$ infinitely often and $100\cdot\frac{x-2}{x}=100-\frac{200}{x} \%$ also infinitely often - thus, it doesn't converge.