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!)
A078823 Sum of distinct binary numbers contained as substrings in binary representation of n. 8

%I #13 Jul 31 2022 07:47:28

%S 0,1,3,4,7,8,12,11,15,16,18,22,28,30,33,26,31,32,34,38,42,39,50,52,60,

%T 62,66,68,77,80,78,57,63,64,66,70,70,76,82,84,90,92,81,96,110,108,118,

%U 114,124,126,130,132,142,140,144,153,165,168,174,177,182,186,171,120

%N Sum of distinct binary numbers contained as substrings in binary representation of n.

%H Reinhard Zumkeller, <a href="/A078823/b078823.txt">Table of n, a(n) for n = 0..10000</a>

%F a(2^k-1) = 2^(k+1)-(k+2); a(2^k) = 2^(k+1)-1;

%F for k>0: a(2^k+1) = 2^(k+1);

%F a(2^k-1) = A078825(2^k-1), a(2^k) = A078825(2^k).

%e n=10: sum of the A078822(10)=5 binary numbers: a(10) = '0'+'1'+'10'+'101'+'1010' = 0+1+2+5+10 = 18.

%o (Haskell)

%o a078823 = sum . a119709_row -- _Reinhard Zumkeller_, Aug 14 2013

%o (Python)

%o def a(n): return sum(set(((((2<<l)-1)<<i)&n)>>i for i in range(n.bit_length()) for l in range(n.bit_length()-i)))

%o print([a(n) for n in range(64)]) # _Michael S. Branicky_, Jul 28 2022

%Y Cf. A078822, A078825, A007088, A144623, A144624.

%K nonn,base

%O 0,3

%A _Reinhard Zumkeller_, Dec 08 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 April 18 10:01 EDT 2024. Contains 371779 sequences. (Running on oeis4.)