login
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).
4

%I #13 Oct 20 2019 15:10:37

%S 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,

%T 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,

%U 0,2,6,8,10,0,1,3,7,8,9,11,0,8,0,1,2,4,9,10,12

%N 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).

%C For any n >= 0, the n-th row:

%C - has sum A328564(n),

%C - has apparently length A002487(n+1),

%C - has first element 0,

%C - has last element A104594(n).

%H Rémy Sigrist, <a href="/A326819/b326819.txt">Table of n, a(n) for n = 0..9851</a> (rows n = 0..512)

%e Table begins:

%e 0;

%e 0;

%e 0, 1;

%e 0;

%e 0, 1, 2;

%e 0, 2;

%e 0, 1, 3;

%e 0;

%e 0, 1, 2, 4;

%e 0, 2, 4;

%e 0, 1, 3, 4, 5;

%e 0, 4;

%e 0, 1, 2, 5, 6;

%e 0, 2, 6;

%e 0, 1, 3, 7;

%e ...

%p T:= n-> sort([{seq(Bits[And](n-k, k), k=0..n)}[]])[]:

%p seq(T(n), n=0..30); # _Alois P. Heinz_, Oct 20 2019

%o (PARI) row(n) = Set(apply(k -> bitand(n-k, k), [0..n]))

%Y Cf. A326820 (OR variant), A328568 (XOR variant).

%Y Cf. A002487, A104594, A328564.

%K nonn,tabf,look,base

%O 0,8

%A _Rémy Sigrist_, Oct 20 2019