login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Number T(n,k) of partitions of n into parts whose bitwise AND equals k; triangle T(n,k), n>=0, 0<=k<=n, read by rows.
4

%I #19 Apr 08 2019 17:28:37

%S 1,0,1,0,1,1,1,1,0,1,1,2,1,0,1,3,2,1,0,0,1,5,3,1,1,0,0,1,9,4,1,0,0,0,

%T 0,1,11,6,3,0,1,0,0,0,1,18,6,3,1,1,0,0,0,0,1,27,8,3,1,1,1,0,0,0,0,1,

%U 38,11,4,0,2,0,0,0,0,0,0,1,53,13,6,1,1,1,1,0,0,0,0,0,1

%N Number T(n,k) of partitions of n into parts whose bitwise AND equals k; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

%H Alois P. Heinz, <a href="/A307432/b307432.txt">Rows n = 0..200, flattened</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Bitwise operation">Bitwise operation</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Partition_(number_theory)">Partition (number theory)</a>

%e T(6,0) = 5: 11112, 1122, 123, 114, 24.

%e T(6,1) = 3: 111111, 1113, 15.

%e T(6,2) = 1: 222.

%e T(6,3) = 1: 33.

%e T(6,6) = 1: 6.

%e Triangle T(n,k) begins:

%e 1;

%e 0, 1;

%e 0, 1, 1;

%e 1, 1, 0, 1;

%e 1, 2, 1, 0, 1;

%e 3, 2, 1, 0, 0, 1;

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

%e 9, 4, 1, 0, 0, 0, 0, 1;

%e 11, 6, 3, 0, 1, 0, 0, 0, 1;

%e 18, 6, 3, 1, 1, 0, 0, 0, 0, 1;

%e 27, 8, 3, 1, 1, 1, 0, 0, 0, 0, 1;

%e ...

%p b:= proc(n, i, k) option remember; `if`(n=0, x^k, `if`(i<1, 0,

%p b(n, i-1, k)+b(n-i, min(n-i, i), Bits[And](i, k))))

%p end:

%p T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(

%p b(n$2, `if`(n=0, 0, 2^ilog2(2*n)-1))):

%p seq(T(n), n=0..14);

%Y Column k=0 gives A307435.

%Y Row sums give A000041.

%Y Main diagonal gives A000012.

%Y Cf. A050314 (the same for XOR), A307431 (the same for OR).

%K nonn,tabl,look,base

%O 0,12

%A _Alois P. Heinz_, Apr 08 2019