The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A205509 Hamming distance between (n-1)! and n!. 18

%I

%S 0,2,1,4,2,4,4,6,4,9,8,15,12,16,14,12,16,23,26,23,21,29,31,34,31,33,

%T 33,44,32,38,42,46,52,51,45,55,55,59,55,59,51,82,65,83,74,75,80,80,80,

%U 74,87,104,86,91,98,90,81,103,104,98,112,104,111,116,111,132

%N Hamming distance between (n-1)! and n!.

%C Problem: To find a better lower estimate for a(n) than the trivial one, which is a(n) >= A000120(floor(log_2(n)).

%C Note that this trivial estimate yields unboundedness of the sequence.

%H Alois P. Heinz, <a href="/A205509/b205509.txt">Table of n, a(n) for n = 1..1000</a>

%e Since 5!=(0001111000)_2 and 6!=(1011010000)_2, then the number of different binary digits is 4. Therefore, a(6)=4.

%p Hamming := proc(a,b)

%p XORnos(a,b) ;

%p wt(%) ;

%p end proc:

%p A205509 := proc(n)

%p Hamming((n-1)!,n!) ;

%p end proc: # _R. J. Mathar_, Apr 02 2012

%t 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 *)

%o (Sage)

%o def A205509(n) :

%o f = bin(factorial(n)).lstrip("0b")

%o g = bin(factorial(n-1)).lstrip("0b")

%o h = "".zfill(len(f)-len(g)) + g

%o return sum(a != b for a, b in zip(f, h))

%o [A205509(k) for k in (1..66)] # Peter Luschny, Jan 31 2012

%Y Cf. A001511.

%K nonn,base

%O 1,2

%A _Vladimir Shevelev_, Jan 28 2012

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified August 14 08:08 EDT 2020. Contains 336480 sequences. (Running on oeis4.)