OFFSET
0,3
COMMENTS
As a flat sequence, this is a permutation of the nonnegative integers with inverse A368240.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..9841 (rows for n = 0..2^9-1 flattened)
FORMULA
EXAMPLE
Table T(n, k) begins:
0;
1;
2, 3;
4;
5, 6, 8, 9;
7, 10;
11, 12;
13;
14, 15, 17, 18, 23, 24, 26, 27;
16, 19, 25, 28;
20, 21, 29, 30;
22, 31;
32, 33, 35, 36;
34, 37;
38, 39;
40;
...
PROG
(PARI) row(n) = { my (r = [0], b = binary(n)); for (k = 1, #b, r = [3*v+b[k]|v<-r]; if (b[k]==0, r = concat(r, [v-1|v<-r]); ); ); Set(r); }
CROSSREFS
KEYWORD
nonn,tabf,base
AUTHOR
Rémy Sigrist, Dec 18 2023
STATUS
approved