OFFSET
0,7
COMMENTS
The standard order of compositions is given by A066099.
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
LINKS
Alois P. Heinz, Rows n = 0..14, flattened
FORMULA
EXAMPLE
Composition number 11 is 2,1,1; 0*2+1*1+2*1 = 3, so a(11) = 3.
The table starts:
0
0
0 1
0 1 2 3
MATHEMATICA
Table[Total[Most[Join@@Position[Reverse[IntegerDigits[n, 2]], 1]]], {n, 30}]
CROSSREFS
KEYWORD
AUTHOR
Franklin T. Adams-Watters, Nov 06 2006
STATUS
approved