login
Zero-based weighted sum of compositions in standard order.
17

%I #17 Jan 26 2023 17:44:28

%S 0,0,0,1,0,1,2,3,0,1,2,3,3,4,5,6,0,1,2,3,3,4,5,6,4,5,6,7,7,8,9,10,0,1,

%T 2,3,3,4,5,6,4,5,6,7,7,8,9,10,5,6,7,8,8,9,10,11,9,10,11,12,12,13,14,

%U 15,0,1,2,3,3,4,5,6,4,5,6,7,7,8,9,10,5,6,7,8,8,9,10,11,9,10,11,12,12,13,14

%N Zero-based weighted sum of compositions in standard order.

%C The standard order of compositions is given by A066099.

%C Sum of all positions of 1's except the last in the reversed binary expansion of n. For example, the reversed binary expansion of 14 is (0,1,1,1), so a(14) = 2 + 3 = 5. Keeping the last position gives A029931. - _Gus Wiseman_, Jan 17 2023

%H Alois P. Heinz, <a href="/A124757/b124757.txt">Rows n = 0..14, flattened</a>

%F For a composition b(1),...,b(k), a(n) = Sum_{i=1..k} (i-1)*b(i).

%F For n>0, a(n) = A029931(n) - A070939(n).

%e Composition number 11 is 2,1,1; 0*2+1*1+2*1 = 3, so a(11) = 3.

%e The table starts:

%e 0

%e 0

%e 0 1

%e 0 1 2 3

%t Table[Total[Most[Join@@Position[Reverse[IntegerDigits[n,2]],1]]],{n,30}]

%Y Cf. A066099, A070939, A029931, A011782 (row lengths), A001788 (row sums).

%Y Row sums of A048793 if we delete the last part of every row.

%Y For prime indices instead of standard comps we have A359674, rev A359677.

%Y Positions of first appearances are A359756.

%Y A003714 lists numbers with no successive binary indices.

%Y A030190 gives binary expansion, reverse A030308.

%Y A230877 adds up positions of 1's in binary expansion, length A000120.

%Y A359359 adds up positions of 0's in binary expansion, length A023416.

%Y Cf. A059015, A065359, A069010, A073642, A083652, A359400, A359402, A359678.

%K nonn,easy,look,tabf

%O 0,7

%A _Franklin T. Adams-Watters_, Nov 06 2006