cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A078565 Number of zeros in the binary expansion of n!.

Original entry on oeis.org

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

Views

Author

Jose R. Brox (tautocrona(AT)terra.es), Jan 26 2003

Keywords

Examples

			a(4) = 3 because 4! = 24_10 = 11000_2 and it has 3 zero digits.
		

Crossrefs

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

Formula

a(n) = A072831(n) - A079584(n). - Michel Marcus, Dec 23 2016