The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A279506 Total number of 1's in the binary expansion of A003418. 2

%I #18 Dec 23 2016 17:42:25

%S 1,1,1,2,2,4,4,4,4,6,6,6,6,12,12,12,12,12,12,12,12,12,12,14,14,21,21,

%T 18,18,17,17,22,22,22,22,22,22,28,28,28,28,25,25,32,32,32,32,40,40,40,

%U 40

%N Total number of 1's in the binary expansion of A003418.

%H Indranil Ghosh, <a href="/A279506/b279506.txt">Table of n, a(n) for n = 0..10000</a>

%F a(n) = A000120(A003418(n)). - _Michel Marcus_, Dec 23 2016

%e For n=10, the LCM of all the numbers from 1 to 10 is 2520 = 100111011000_2, which has a total of 6 1's, so a(10)=6.

%t Map[DigitCount[#, 2, 1] &, FoldList[LCM, 1, Range@ 50]] (* _Michael De Vlieger_, Dec 13 2016 *)

%o (Python)

%o def gcd(a, b):

%o while b:

%o a, b = b, a % b

%o return a

%o def lcm(a, b):

%o return a * b // gcd(a, b)

%o def c(*ar):

%o return reduce(lcm, ar)

%o def a(n):

%o if n==0:

%o return 1

%o x=bin(c(*range(1,n+1)))[2:]

%o return x.count("1")

%o for i in range(0,10001):

%o print str(i)+" "+str(a(i))

%o (PARI) a(n) = hammingweight(lcm(vector(n, k, k))); \\ _Michel Marcus_, Dec 14 2016

%Y Cf. A000120, A003418.

%K nonn,base

%O 0,4

%A _Indranil Ghosh_, Dec 13 2016

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 11 18:20 EDT 2024. Contains 373315 sequences. (Running on oeis4.)