<s>[INST] Number of times $2^k$ appears in factorial 
For what $n$ does: $2^n | 19!18!...1!$?

I checked how many times $2^1$ appears:
It appears in, $2!, 3!, 4!... 19!$ meaning, $2^{18}$ 
I checked how many times $2^2 = 4$ appears:
It appears in, $4!, 5!, 6!, ..., 19!$ meaning, $4^{16} = 2^{32}$
I checked how many times $2^3 = 8$ appears:
It appears in, $8!, 9!, ..., 19!$ meaning, $8^{12} = 2^{36}$
I checked how many times $2^{4} = 16$ appears:
It appears in, $16!, 17!, 18!, 19!$ meaning, $16^{4} = 2^{16}$
In all, 
$$2^{18} \cdot 2^{32} \cdot 2^{36} \cdot 2^{16} = 2^{102}$$
But that is the wrong answer, its supposed to be $2^{150}$?
 [/INST] A simple trick to compute $k$ such that $2^k|n!$ is to compute $\sum_{i=1}^\infty \left\lfloor\frac{n}{2^i}\right\rfloor$, this is because $n$ has $[n/2]$ numbers divided by $2$, if we pick out these numbers and find out that there're $[n/4]$ numbers divided by $4$.. If we continue this procedure, we see that $$k=1\cdot\left(\left\lfloor\frac{n}{2}\right\rfloor-\left\lfloor\frac{n}{4}\right\rfloor\right)+2\left(\left\lfloor\frac{n}{4}\right\rfloor-\left\lfloor\frac{n}{8}\right\rfloor\right)+\ldots=\sum_{i=1}^\infty \left\lfloor\frac{n}{2^i}\right\rfloor$$. In this case, we have to sum
$$0+1+1+3+3+4+4+7+7+8+8+10+10+11+11+15+15+16+16=150.$$
Your fault is that your did not count the contribution of those which is not the power of $2$. For instance, there's $14$ in $14!$..
</s>