cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

A050314 Triangle: a(n,k) = number of partitions of n whose xor-sum is k.

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 0, 1, 0, 2, 2, 0, 2, 0, 1, 0, 3, 0, 2, 0, 2, 4, 0, 3, 0, 2, 0, 2, 0, 4, 0, 4, 0, 2, 0, 5, 6, 0, 5, 0, 4, 0, 6, 0, 1, 0, 8, 0, 6, 0, 8, 0, 6, 0, 2, 10, 0, 9, 0, 11, 0, 8, 0, 2, 0, 2, 0, 11, 0, 14, 0, 12, 0, 12, 0, 2, 0, 5, 16, 0, 18, 0, 15, 0, 16, 0, 4, 0, 6, 0, 2, 0, 23, 0, 20, 0, 20, 0, 19, 0, 8, 0, 6, 0, 5
Offset: 0

Views

Author

Christian G. Bower, Sep 15 1999

Keywords

Examples

			Triangle: a(n,k) begins:
   1;
   0,  1;
   1,  0,  1;
   0,  1,  0,  2;
   2,  0,  2,  0,  1;
   0,  3,  0,  2,  0,  2;
   4,  0,  3,  0,  2,  0,  2;
   0,  4,  0,  4,  0,  2,  0,  5;
   6,  0,  5,  0,  4,  0,  6,  0, 1;
   0,  8,  0,  6,  0,  8,  0,  6, 0, 2;
  10,  0,  9,  0, 11,  0,  8,  0, 2, 0, 2;
   0, 11,  0, 14,  0, 12,  0, 12, 0, 2, 0, 5;
  16,  0, 18,  0, 15,  0, 16,  0, 4, 0, 6, 0, 2;
  ...
		

Crossrefs

a(2n,0) = A048833(n). a(2n+1,1) = A050316(n). a(n,n) = A050315(n).
Row sums give A000041.
a(4n,2n) gives A370874.

Programs

  • Maple
    with(Bits):
    b:= proc(n, i, k) option remember; `if`(n=0, x^k, `if`(i<1, 0,
          add(b(n-i*j, i-1, `if`(j::even, k, Xor(i, k))), j=0..n/i)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n$2, 0)):
    seq(T(n), n=0..20);  # Alois P. Heinz, Dec 01 2015
  • Mathematica
    b[n_, i_, k_] := b[n, i, k] = If[n==0, x^k, If[i<1, 0, Sum[b[n-i*j, i-1, If[EvenQ[j], k, BitXor[i, k]]], {j, 0, n/i}]]]; T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, n}]][b[n, n, 0]]; Table[T[n], {n, 0, 20}] // Flatten (* Jean-François Alcover, Jan 24 2016, after Alois P. Heinz *)

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

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 0, 2, 0, 1, 1, 2, 1, 0, 1, 0, 4, 0, 2, 0, 1, 1, 5, 0, 2, 2, 0, 1, 0, 7, 0, 2, 0, 5, 0, 1, 1, 8, 1, 2, 2, 6, 1, 0, 1, 0, 11, 0, 4, 0, 12, 0, 2, 0, 1, 1, 12, 0, 5, 4, 15, 0, 2, 2, 0, 1, 0, 15, 0, 5, 0, 28, 0, 2, 0, 5, 0, 1, 1, 17, 1, 5, 5, 35, 0, 2, 2, 6, 2
Offset: 0

Views

Author

Alois P. Heinz, Apr 08 2019

Keywords

Examples

			T(6,1) = 1: 111111.
T(6,2) = 1: 222.
T(6,3) = 5: 11112, 1122, 1113, 123, 33.
T(6,5) = 2: 114, 15.
T(6,6) = 2: 24, 6.
Triangle T(n,k) begins:
  1;
  0, 1;
  0, 1, 1;
  0, 1, 0,  2;
  0, 1, 1,  2, 1;
  0, 1, 0,  4, 0, 2;
  0, 1, 1,  5, 0, 2, 2;
  0, 1, 0,  7, 0, 2, 0,  5;
  0, 1, 1,  8, 1, 2, 2,  6, 1;
  0, 1, 0, 11, 0, 4, 0, 12, 0, 2;
  0, 1, 1, 12, 0, 5, 4, 15, 0, 2, 2;
  ...
		

Crossrefs

Columns k=0-1 give: A000007, A057427.
Row sums give: A000041.
Main diagonal gives A050315.
Cf. A050314 (the same for XOR), A307432 (the same for AND).

Programs

  • Maple
    b:= proc(n, i, k) option remember; `if`(n=0, x^k, `if`(i<1, 0,
          b(n, i-1, k)+b(n-i, min(n-i, i), Bits[Or](i, k))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n$2, 0)):
    seq(T(n), n=0..14);

A307435 Number of partitions of n into parts whose bitwise AND equals 0.

Original entry on oeis.org

1, 0, 0, 1, 1, 3, 5, 9, 11, 18, 27, 38, 53, 75, 102, 137, 178, 238, 313, 406, 528, 677, 865, 1093, 1382, 1742, 2181, 2717, 3377, 4175, 5146, 6320, 7737, 9454, 11516, 13986, 16950, 20473, 24682, 29672, 35631, 42663, 50992, 60807, 72399, 86008, 102027, 120793
Offset: 0

Views

Author

Alois P. Heinz, Apr 08 2019

Keywords

Examples

			a(0) = 1: the empty partition.
a(3) = 1: 21.
a(4) = 1: 211.
a(5) = 3: 2111, 221, 41.
a(6) = 5: 21111, 2211, 321, 411, 42.
a(7) = 9: 211111, 22111, 2221, 3211, 4111, 421, 43, 52, 61.
a(8) = 11: 2111111, 221111, 22211, 32111, 3221, 41111, 4211, 422, 431, 521, 611.
a(9) = 18: 21111111, 2211111, 222111, 22221, 321111, 32211, 3321, 411111, 42111, 4221, 4311, 432, 441, 5211, 522, 6111, 621, 81.
		

Crossrefs

Column k=0 of A307432.

Programs

  • Maple
    b:= proc(n, i, k) option remember; `if`(n=0, `if`(k=0, 1, 0),
         `if`(i<1, 0, b(n, i-1, k)+b(n-i, min(n-i, i), Bits[And](i, k))))
        end:
    a:= n-> b(n$2, `if`(n=0, 0, 2^ilog2(2*n)-1)):
    seq(a(n), n=0..50);
Showing 1-3 of 3 results.