|
|
A227738
|
|
Irregular table read by rows: each row n (n>=1) lists the positions where the runs of bits change between 0's and 1's in the binary expansion of n, when scanning it from the least significant to the most significant end.
|
|
9
|
|
|
1, 1, 2, 2, 2, 3, 1, 2, 3, 1, 3, 3, 3, 4, 1, 3, 4, 1, 2, 3, 4, 2, 3, 4, 2, 4, 1, 2, 4, 1, 4, 4, 4, 5, 1, 4, 5, 1, 2, 4, 5, 2, 4, 5, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 3, 4, 5, 3, 4, 5, 3, 5, 1, 3, 5, 1, 2, 3, 5, 2, 3, 5, 2, 5, 1, 2, 5, 1, 5, 5, 5, 6, 1, 5, 6, 1, 2, 5, 6
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
As a sequence, seems to have a particular fractal structure, probably allowing additional formulas.
Row n lists the positions of 1-bits in the binary expansion of the Gray code for n, A003188(n), when 1 is the rightmost position. A003188(17) = 25 = 11001_2 gives row 17: 1,4,5. - Alois P. Heinz, Feb 01 2023
|
|
LINKS
|
|
|
FORMULA
|
Alternatively, if A227740(n) is 0, then a(n) = A227736(n), otherwise a(n) = a(n-1) + A227736(n). [Each row gives cumulative sums of the runlengths of binary representation of n]
|
|
EXAMPLE
|
Table begins as:
Row n in Terms on
n binary that row
1 1 1;
2 10 1,2;
3 11 2;
4 100 2,3;
5 101 1,2,3;
6 110 1,3;
7 111 3;
8 1000 3,4;
9 1001 1,3,4;
10 1010 1,2,3,4;
11 1011 2,3,4;
12 1100 2,4;
13 1101 1,2,4;
14 1110 1,4;
15 1111 4;
16 10000 4,5;
etc.
The terms also give the partial sums of runlengths, when the binary expansion of n is scanned from the least significant to the most significant end.
|
|
MAPLE
|
T:= n-> (l-> seq(`if`(l[i]=1, i, [][]), i=1..nops(l)))(
Bits[Split](Bits[Xor](n, iquo(n, 2)))):
|
|
MATHEMATICA
|
Table[Rest@FoldList[Plus, 0, Length/@Split[Reverse[IntegerDigits[n, 2]]]], {n, 34}]//Flatten (Wouter Meeussen, Aug 31 2013)
|
|
PROG
|
|
|
CROSSREFS
|
Each row n (n>=1) contains the initial A005811(n) nonzero terms from the beginning of row n of A227188. A227192(n) gives the sum of terms on row n. A136480 gives the first column.
|
|
KEYWORD
|
nonn,base,tabf
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|