OFFSET
1,2
COMMENTS
Problem: To find a better lower estimate for a(n) than the trivial one, which is a(n) >= A000120(floor(log_2(n))).
Note that this trivial estimate yields unboundedness of the sequence.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
EXAMPLE
Since 5!=(0001111000)_2 and 6!=(1011010000)_2, then the number of different binary digits is 4. Therefore, a(6)=4.
MAPLE
read("transforms") :
Hamming := proc(a, b)
XORnos(a, b) ;
wt(%) ;
end proc:
A205509 := proc(n)
Hamming((n-1)!, n!) ;
end proc: # R. J. Mathar, Apr 02 2012
MATHEMATICA
nn = 100; Table[b2 = IntegerDigits[n!, 2]; b1 = IntegerDigits[(n - 1)!, 2, Length[b2]]; Total[Abs[b1 - b2]], {n, nn}] (* T. D. Noe, Jan 31 2012 *)
PROG
(Sage)
def A205509(n) :
f = bin(factorial(n)).lstrip("0b")
g = bin(factorial(n-1)).lstrip("0b")
h = "".zfill(len(f)-len(g)) + g
return sum(a != b for a, b in zip(f, h))
[A205509(k) for k in (1..66)] # Peter Luschny, Jan 31 2012
(Python 3.10+)
from math import factorial
def A205509(n): return ((f:=factorial(n-1))^f*n).bit_count() # Chai Wah Wu, Jul 13 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Vladimir Shevelev, Jan 28 2012
STATUS
approved