%I #92 Dec 02 2019 03:46:31
%S 0,1,3,4,7,11,12,11,15,24,31,29,28,37,33,26,31,49,66,61,71,92,85,67,
%T 60,87,103,90,77,95,78,57,63,98,133,121,150,191,177,138,151,215,254,
%U 219,197,240,199,145,124,185,237,210,235,293,262,199,165,230,263,223
%N a(n) is the sum of the distinct numbers whose binary digits appear in order but not necessarily as consecutive digits in the binary representation of n.
%H Rémy Sigrist, <a href="/A328379/b328379.txt">Table of n, a(n) for n = 0..16384</a>
%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F A078823(n) <= a(n).
%F a(2^k) = 2^(k+1)-1 for any k >= 0.
%F a(2^k-1) = A000295(k+1) for any k >= 0.
%e The first terms, alongside the binary representations of n as well as those of the numbers that appear in it, are:
%e n a(n) bin(n) {bin(s)}
%e -- ---- ------ ----------------------------
%e 0 0 0 {0}
%e 1 1 1 {1}
%e 2 3 10 {0, 1, 10}
%e 3 4 11 {1, 11}
%e 4 7 100 {0, 1, 10, 100}
%e 5 11 101 {0, 1, 10, 11, 101}
%e 6 12 110 {0, 1, 10, 11, 110}
%e 7 11 111 {1, 11, 111}
%e 8 15 1000 {0, 1, 10, 100, 1000}
%e 9 24 1001 {0, 1, 10, 11, 100, 101, 1001}
%e 10 31 1010 {0, 1, 10, 11, 100, 101, 110, 1010}
%o (PARI) a(n, base=2) = { my (b=digits(n, base), s=[0]); for (k=1, #b, s = setunion(s, apply(o -> base*o+b[k], s))); vecsum(s) }
%Y Cf. A000295, A078823, A329873.
%K nonn,base
%O 0,3
%A _Rémy Sigrist_, Nov 30 2019