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!)
A079073 Sum of numbers < n having in binary representation the same number of 1's as n. 3

%I #16 Nov 07 2020 05:31:46

%S 0,0,1,0,3,3,8,0,7,14,23,7,33,18,31,0,15,45,62,45,80,64,85,15,100,107,

%T 132,38,158,65,94,0,31,124,157,186,191,221,258,124,227,296,337,163,

%U 379,206,251,31,267,423,472,297,522,348,401,78,574,455,512,133,570,192,253,0,63

%N Sum of numbers < n having in binary representation the same number of 1's as n.

%H Alois P. Heinz, <a href="/A079073/b079073.txt">Table of n, a(n) for n = 0..16383</a>

%p f:= n-> add(i, i=convert(n, base, 2)):

%p b:= proc(n) b(n):= b(n-1)+n*x^f(n) end: b(-1):=0:

%p a:= n-> coeff(b(n-1), x, f(n)):

%p seq(a(n), n=0..150); # _Alois P. Heinz_, Feb 08 2018

%t a[n_] := Module[{dc = DigitCount[n, 2, 1]}, Select[Range[n-1], DigitCount[#, 2, 1] == dc&] // Total];

%t a /@ Range[0, 100] (* _Jean-François Alcover_, Nov 07 2020 *)

%o (PARI) a(n) = my(s=hammingweight(n)); sum(k=1, n-1, if (s==hammingweight(k), k)); \\ _Michel Marcus_, Nov 07 2020

%Y Cf. A079072, A079074, A068076, A007088, A000120.

%K nonn,look,base

%O 0,5

%A _Reinhard Zumkeller_, Dec 21 2002

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 17 00:51 EDT 2024. Contains 373432 sequences. (Running on oeis4.)