A326819 Irregular triangle read by rows; for n >= 0, the n-th row corresponds to the elements of the set {(n-k) AND k, k = 0..n}, in ascending order (where AND denotes the bitwise AND operator).
0, 0, 0, 1, 0, 0, 1, 2, 0, 2, 0, 1, 3, 0, 0, 1, 2, 4, 0, 2, 4, 0, 1, 3, 4, 5, 0, 4, 0, 1, 2, 5, 6, 0, 2, 6, 0, 1, 3, 7, 0, 0, 1, 2, 4, 8, 0, 2, 4, 8, 0, 1, 3, 4, 5, 8, 9, 0, 4, 8, 0, 1, 2, 5, 6, 8, 9, 10, 0, 2, 6, 8, 10, 0, 1, 3, 7, 8, 9, 11, 0, 8, 0, 1, 2, 4, 9, 10, 12
Offset: 0
Examples
Table begins: 0; 0; 0, 1; 0; 0, 1, 2; 0, 2; 0, 1, 3; 0; 0, 1, 2, 4; 0, 2, 4; 0, 1, 3, 4, 5; 0, 4; 0, 1, 2, 5, 6; 0, 2, 6; 0, 1, 3, 7; ...
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..9851 (rows n = 0..512)
Programs
-
Maple
T:= n-> sort([{seq(Bits[And](n-k, k), k=0..n)}[]])[]: seq(T(n), n=0..30); # Alois P. Heinz, Oct 20 2019
-
PARI
row(n) = Set(apply(k -> bitand(n-k, k), [0..n]))
Comments