A078565 Number of zeros in the binary expansion of n!.
0, 0, 1, 1, 3, 3, 6, 7, 10, 13, 11, 19, 17, 21, 25, 23, 27, 27, 30, 40, 40, 41, 42, 44, 51, 54, 54, 56, 56, 63, 60, 71, 76, 77, 77, 77, 88, 86, 90, 90, 97, 99, 106, 105, 107, 117, 115, 117, 114, 122, 126, 130, 138, 138, 151, 144, 146, 157, 160, 158, 160, 176
Offset: 0
Examples
a(4) = 3 because 4! = 24_10 = 11000_2 and it has 3 zero digits.
Links
- T. D. Noe, Table of n, a(n) for n = 0..1000
Programs
-
Mathematica
Table[Count[IntegerDigits[n!, 2], 0], {n, 0, 100}] (* T. D. Noe, Apr 10 2012 *) DigitCount[Range[0,70]!,2,0] (* Harvey P. Dale, Mar 11 2019 *)
-
PARI
for(n=1,300,b=binary(n!); print1(sum(k=1,length(b),if(b[k],0,1))","))
-
Python
import math def a(n): return bin(math.factorial(n))[2:].count("0") # Indranil Ghosh, Dec 23 2016