Find the greatest powers of $2$ dividing $10!$, $20!$, $30!$, $40!$ I'm trying to find the greatest powers of $2$ dividing $10!$, $20!$, $30!$, $40!$, as part of a basic number systems course.
I'm rather lost with this question. For $10!$ I tried writing the terms out and just extracting powers of $2$ manually, getting $2^8$ as the highest powers of $2$, with $10! = (2^8)(14175)$ as the result.
I'm fairly confident that the answer is correct (although I'm not sure, so confirmation of that would be great!), but this method is rather crude for larger numbers, so I suspect that it isn't the right way to do it.
If anyone can point me in the right direction I would be very grateful.

One way to do it is to count the ammount of numbers divisible by $2,4,8,...$ between $1$ and $n$. For example, look at $40!$:
There are $\left\lfloor\frac{40}{32}\right\rfloor=1$ numbers divisible by $32$ (between $1$ and $40$) and each contributes $2^5$.
There are $\left\lfloor\frac{40}{16}\right\rfloor=2$ numbers divisible by $16$ and each contributes $2^4$.
There are $\left\lfloor\frac{40}{8}\right\rfloor=5$ numbers divisible by $8$ and each contributes $2^3$.
There are $\left\lfloor\frac{40}{4}\right\rfloor=10$ numbers divisible by $4$ and each contributes $2^2$.
There are $\left\lfloor\frac{40}{2}\right\rfloor=20$ numbers divisible by $2$ and each contributes $2^1$.
Hence the biggest power that will divide $40!$ is $1+2+5+10+20=38$ (i.e. $(2^5)^1(2^4)^2(2^3)^5(2^2)^{10}(2^1)^{20}=2^{38}$), since that way a number divisible by $32$ is counted $5$ times, a number divisible by $16$ is counted $4$ times and so on.
Applying the same method to $10!$ you get: $1$ number divisible by $8$, $2$ numbers divisible by $4$, $5$ numbers divisible by $2$. So total of $1+2+5=8$. Hence $2^8$ is the highest power.
