login
A233932
Irregular table read by rows: T(n,k) is the binary representation of n shifted right k times and incremented if the last bit shifted away was set.
2
1, 1, 1, 2, 1, 2, 1, 1, 3, 1, 1, 3, 2, 1, 4, 2, 1, 4, 2, 1, 1, 5, 2, 1, 1, 5, 3, 1, 1, 6, 3, 1, 1, 6, 3, 2, 1, 7, 3, 2, 1, 7, 4, 2, 1, 8, 4, 2, 1, 8, 4, 2, 1, 1, 9, 4, 2, 1, 1, 9, 5, 2, 1, 1, 10, 5, 2, 1, 1, 10, 5, 3, 1, 1, 11, 5, 3, 1, 1, 11, 6, 3, 1, 1, 12, 6, 3, 1, 1, 12, 6, 3, 2, 1, 13, 6, 3, 2, 1, 13, 7, 3, 2, 1, 14, 7
OFFSET
1,4
COMMENTS
The last bit shifted away is the (k-1)-th bit from the right.
The length of the n-th row is A070939(n).
Terms in the n-th row add to n.
From Gary W. Adamson, Jun 07 2021: (Start)
A production matrix is the irregular triangle (n, A001511(k)) = 1 otherwise 0:
1;
0, 1;
1;
0, 0, 1;
1;
0, 1;
1;
0, 0, 0, 1;
...
Let the matrix = M, then take partial sums from the top -> down, by columns.
The result is A233932. If the 1's are replaced by any sequence, say 2n-1, the result using the same procedure is an analogous sequence with row sums equal to the partial sums of the replacement sequence. For example, with (1, 3, 5, 7, ...) the result is an array with row sums = the squares, (1, 4, 9, 16, 25, ...), as follows:
1;
1, 3;
6, 3;
6, 3, 7;
15, 3, 7;
15, 14, 7;
28, 14, 7;
28, 14, 7, 15;
45, 14, 7, 15;
45, 37, 7, 15;
... (End)
FORMULA
T(n,k) = round(n/2^k), 1 <= k <= floor(log_2(n)) + 1, where round(1/2)=1. - Ridouane Oudra, Sep 02 2019
EXAMPLE
22 in binary is 10110, so the row length is 5. T(22, 1) = 11, T(22, 2) = 5 + 1 = 6, T(22, 3) = 2 + 1 = 3, T(22, 4) = 1, T(22, 5) = 0 + 1. So the 22nd row reads 11, 6, 3, 1, 1.
Table starts:
1;
1, 1;
2, 1;
2, 1, 1;
3, 1, 1;
3, 2, 1;
4, 2, 1;
4, 2, 1, 1;
5, 2, 1, 1;
5, 3, 1, 1;
...
PROG
(PARI) T(n, k)=b=binary(n); n\2^k+b[#b-k+1]
(PARI) row(n) = my(b=binary(n)); vector(#b, k, n\2^k+b[#b-k+1]); \\ Michel Marcus, Sep 03 2019
CROSSREFS
Cf. A120385.
Cf. A079559.
Sequence in context: A253667 A360189 A368210 * A008289 A326625 A188884
KEYWORD
nonn,tabf
AUTHOR
Ralf Stephan, Dec 18 2013
STATUS
approved