This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A162439 #31 Jan 07 2016 14:39:29 %S A162439 1,2,2,4,3,3,3,8,5,4,4,5,4,4,4,16,9,6,6,6,5,5,5,9,6,5,5,6,5,5,5,32,17, %T A162439 10,10,8,7,7,7,10,7,6,6,7,6,6,6,17,10,7,7,7,6,6,6,10,7,6,6,7,6,6,6,64, %U A162439 33,18,18,12,11,11,11,12,9,8,8,9,8,8,8,18,11,8,8,8,7,7,7,11,8,7,7,8,7,7 %N A162439 Write down the binary representation of n. Partition the string which is this binary representation by placing a '+' just left of every 1. Add the resulting base 2 numbers. a(n) = decimal equivalent of this sum. %C A162439 From _Vladimir Shevelev_, Dec 11 2014: (Start) %C A162439 Or, sum of parts of the form 10...0 with nonnegative number of zeros in binary representation of n as the corresponding powers of 2. For example, n=50 in binary is a concatenation of parts (1)(100)(10). Then a(50)=1+4+2=7. %C A162439 Every positive number k occurs a finite number of times, such that the position of the last appearance of k is 2^k-1. %C A162439 Moreover, the number of times of appearances of k is the number of compositions of k into powers of 2, i.e., it is A023359(k), k>0. (End) %H A162439 Alois P. Heinz, <a href="/A162439/b162439.txt">Table of n, a(n) for n = 1..10000</a> %F A162439 Let, for k_1>k_2>...>k_r, n = 2^k_1 + 2^k_2 +...+ 2^k_r. Then a(n) = 2^(k_1-k_2-1) + 2^(k_2-k_3-1) + 2^(k_(r-1)-k_r-1) + 2^k_r. - _Vladimir Shevelev_, Dec 11 2013 %e A162439 52 in binary is 110100. Placing the +'s before every 1, we get +1+10+100, which is 1+2+4 = 7 in decimal. So a(52) = 7. %p A162439 a:= proc(n) local l, s, i, j; l:= convert(n, base, 2); s:= 0; i:=1; for j from nops(l)-1 to 1 by -1 do if l[j]=0 then i:= i*2; else s:= s+i; i:= 1 fi od; s+i end: seq(a(n), n=1..150); # _Alois P. Heinz_, Jul 28 2009 %p A162439 Lton := proc(L) local i ; add(op(i,L)*2^(i-1),i=1..nops(L)) ; end: A162439 := proc(n) local a,lef,b2,ri ; a := 0 ; lef := 0; b2 := convert(n,base,2) ; for ri from lef+1 do if op(ri,b2) = 1 then a := a+Lton([op(lef+1..ri,b2)]) ; lef := ri ; fi; if ri =nops(b2) then break; fi; od: a ; end: seq(A162439(n),n=1..100) ; # _R. J. Mathar_, Jul 30 2009 %t A162439 a[n_] := FromDigits[#, 2]& /@ Split[IntegerDigits[n, 2] , #2==0&] // Total; Array[a, 100] (* _Jean-François Alcover_, Jan 07 2016 *) %Y A162439 Cf. A124771, A233249, A233312, A233416, A233420, A233564, A233569, A233655. %K A162439 base,nonn,look %O A162439 1,2 %A A162439 _Leroy Quet_, Jul 03 2009 %E A162439 More terms from _Alois P. Heinz_ and _R. J. Mathar_, Jul 28 2009