OFFSET
0,4
FORMULA
Let L(n) = (length of binary representation of n) - 0^n then
T(n, k) = n if k=0 else n - 2^(k-1) for n >= 0 and 0 <= k <= L(n).
Sum_{k=0..L(n)} T(n,k) = A123753(n-1) for n>=1.
EXAMPLE
0;
1, 0;
2, 1, 0;
3, 2, 1;
4, 3, 2, 0;
5, 4, 3, 1;
6, 5, 4, 2;
7, 6, 5, 3;
8, 7, 6, 4, 0;
9, 8, 7, 5, 1;
10, 9, 8, 6, 2;
11, 10, 9, 7, 3;
12, 11, 10, 8, 4;
13, 12, 11, 9, 5;
14, 13, 12, 10, 6;
15, 14, 13, 11, 7;
MAPLE
A295508_row := proc(n) local i, s, z; s := n; i := n-1; z := 1;
while 0 <= i do s := s, i; i := i-z; z := z+z od; s end:
seq(A295508_row(n), n=0..17);
# Alternatively after formula:
T := (n, k) -> `if`(k=0, n, n - 2^(k-1)):
L := n -> nops(convert(n, base, 2)) - 0^n:
T_row := n -> seq(T(n, k), k=0..L(n)):
seq(T_row(n), n=0..17);
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Peter Luschny, Nov 30 2017
STATUS
approved