OFFSET
0,3
LINKS
FORMULA
a(n) = floor(log(n!)/log(2)) + 1.
EXAMPLE
a(4)=5 because 4! = 4*3*2*1 = 24 (base 10) = 11000 (base 2), using 5 bits.
MAPLE
a:= n-> 1+ilog2(n!):
seq(a(n), n=0..100); # Alois P. Heinz, May 03 2016
MATHEMATICA
Floor[Log[2, Range[0, 60]!]]+1 (* Harvey P. Dale, Nov 16 2011 *)
PROG
(PARI) for(n=0, 100, print1(floor(log(n!)/log(2))+1, ", "))
(PARI) a(n) = #binary(n!); \\ Michel Marcus, Dec 23 2016
(Python)
import math
def a(n):
return len(bin(math.factorial(n))[2:]) # Indranil Ghosh, Dec 23 2016
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Rick L. Shepherd, Jul 22 2002
STATUS
approved