|
|
A163510
|
|
Irregular table read by rows: Write n in binary. For each 1, the m-th term of row n is the number of 0's between the m-th 1, reading right to left, and the (m-1)th 1 (or the right side of the number if m-1 = 0).
|
|
7
|
|
|
0, 1, 0, 0, 2, 0, 1, 1, 0, 0, 0, 0, 3, 0, 2, 1, 1, 0, 0, 1, 2, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 4, 0, 3, 1, 2, 0, 0, 2, 2, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 3, 0, 0, 2, 0, 1, 1, 0, 0, 0, 1, 0, 2, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 4, 1, 3, 0, 0, 3, 2, 2, 0, 1, 2, 1, 0, 2, 0, 0, 0, 2, 3, 1, 0, 2, 1, 1, 1, 1, 0, 0, 1, 1, 2, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,5
|
|
COMMENTS
|
Row n contains exactly A000120(n) terms, for each n.
All odd-numbered rows begin with 0. All even-numbered rows begin with a positive integer.
Can be used to compute the permutation A163511.
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
Table begins as:
Row n in Terms on
n binary that row
1 1 0; (the distance of 1-bit from the right edge is zero)
2 10 1; (the distance of 1-bit from the right edge is one)
3 11 0,0;
4 100 2;
5 101 0,1; (the least significant 1-bit is zero steps away from the right edge, and there is one zero between those two 1-bits)
6 110 1,0;
7 111 0,0,0;
8 1000 3;
9 1001 0,2;
10 1010 1,1;
11 1011 0,0,1;
12 1100 2,0;
13 1101 0,1,0;
14 1110 1,0,0;
15 1111 0,0,0,0;
16 10000 4;
|
|
MATHEMATICA
|
Table[Reverse@ Map[Ceiling[(Length@ # - 1)/2] &, DeleteCases[Split@ Join[Riffle[IntegerDigits[n, 2], 0], {0}], {k__} /; k == 1]], {n, 46}] // Flatten (* Michael De Vlieger, Jul 25 2016 *)
|
|
PROG
|
(Python)
from itertools import count, islice
def A163510_gen(): # generator of terms
for n in count(1):
k = n
while k:
yield (s:=(~k&k-1).bit_length())
k >>= s+1
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,nonn,tabf
|
|
AUTHOR
|
|
|
EXTENSIONS
|
Additional terms computed and Example section added by Antti Karttunen, Jun 19 2014
|
|
STATUS
|
approved
|
|
|
|