

A233932


Irregular table read by rows: T(n,k) = binary representation of n shifted right k times and incremented if the last shifted away bit was set.


0



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
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,4


COMMENTS

The last shifted away bit is the (k1)th bit from the right.
The length of the nth row is A070939(n).
Terms in the nth row add to n.


LINKS

Table of n, a(n) for n=1..106.
Index entries for sequences related to binary expansion of n


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[#bk+1]
(PARI) row(n) = my(b=binary(n)); vector(#b, k, n\2^k+b[#bk+1]); \\ Michel Marcus, Sep 03 2019


CROSSREFS

Cf. A120385.
Sequence in context: A249809 A075104 A253667 * A008289 A326625 A188884
Adjacent sequences: A233929 A233930 A233931 * A233933 A233934 A233935


KEYWORD

nonn,tabf,changed


AUTHOR

Ralf Stephan, Dec 18 2013


STATUS

approved



