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-2 of 2 results.

A281871 Number T(n,k) of k-element subsets of [n] having a square element sum; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 2, 1, 1, 0, 1, 2, 2, 2, 0, 0, 1, 2, 3, 3, 2, 1, 0, 1, 2, 4, 5, 5, 2, 1, 0, 1, 2, 5, 8, 8, 6, 3, 0, 1, 1, 3, 6, 11, 14, 13, 7, 4, 1, 0, 1, 3, 7, 15, 23, 24, 19, 10, 3, 1, 0, 1, 3, 8, 20, 34, 43, 39, 25, 13, 3, 1, 0, 1, 3, 9, 26, 49, 71, 74, 60, 34, 14, 5, 0, 0
Offset: 0

Views

Author

Alois P. Heinz, Jan 31 2017

Keywords

Examples

			T(7,0) = 1: {}.
T(7,1) = 2: {1}, {4}.
T(7,2) = 4: {1,3}, {2,7}, {3,6}, {4,5}.
T(7,3) = 5: {1,2,6}, {1,3,5}, {2,3,4}, {3,6,7}, {4,5,7}.
T(7,4) = 5: {1,2,6,7}, {1,3,5,7}, {1,4,5,6}, {2,3,4,7}, {2,3,5,6}.
T(7,5) = 2: {1,2,3,4,6}, {3,4,5,6,7}.
T(7,6) = 1: {1,2,4,5,6,7}.
T(7,7) = 0.
T(8,8) = 1: {1,2,3,4,5,6,7,8}.
Triangle T(n,k) begins:
  1;
  1, 1;
  1, 1, 0;
  1, 1, 1,  0;
  1, 2, 1,  1,  0;
  1, 2, 2,  2,  0,  0;
  1, 2, 3,  3,  2,  1,  0;
  1, 2, 4,  5,  5,  2,  1,  0;
  1, 2, 5,  8,  8,  6,  3,  0,  1;
  1, 3, 6, 11, 14, 13,  7,  4,  1,  0;
  1, 3, 7, 15, 23, 24, 19, 10,  3,  1, 0;
  1, 3, 8, 20, 34, 43, 39, 25, 13,  3, 1, 0;
  1, 3, 9, 26, 49, 71, 74, 60, 34, 14, 5, 0, 0;
  ...
		

Crossrefs

Main diagonal is characteristic function of A001108.
Diagonals T(n+k,n) for k=2-10 give: A281965, A281966, A281967, A281968, A281969, A281970, A281971, A281972, A281973.
Row sums give A126024.
T(2n,n) gives A281872.

Programs

  • Maple
    b:= proc(n, s) option remember; expand(`if`(n=0,
          `if`(issqr(s), 1, 0), b(n-1, s)+x*b(n-1, s+n)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n, 0)):
    seq(T(n), n=0..16);
  • Mathematica
    b[n_, s_] := b[n, s] = Expand[If[n == 0, If[IntegerQ @ Sqrt[s], 1, 0], b[n - 1, s] + x*b[n - 1, s + n]]];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, n}]][b[n, 0]];
    Table[T[n], {n, 0, 10}] // Flatten (* Jean-François Alcover, Jun 03 2018, from Maple *)

Formula

T(n,n) = 1 for n in { A001108 }, T(n,n) = 0 otherwise.
T(n,n-1) = 1 for n in { A214857 }, T(n,n-1) = 0 for n in { A214858 }.
Sum_{k=0..n} k * T(n,k) = A377572(n).

A278339 Number of set partitions of [n] into subsets whose element sums are distinct squares.

Original entry on oeis.org

1, 1, 0, 0, 1, 0, 1, 0, 1, 23, 9, 41, 248, 277, 1556, 2854, 5233, 20701, 145137, 1626890, 4118910, 9963276, 9260756, 64027363, 365237571, 1002679107, 21594036300, 24465529531, 144914973347, 1921444799766
Offset: 0

Views

Author

Alois P. Heinz, Nov 18 2016

Keywords

Examples

			a(0) = 1: {}.
a(1) = 1: 1.
a(4) = 1: 1|234.
a(6) = 1: 1|2356|4.
a(8) = 1: 12345678.
a(9) = 23: 12345678|9, 123568|4|79, 1236789|45, 1245789|36, 126|345789, 12589|367|4, 1258|3679|4, 12679|358|4, 1267|3589|4, 1345689|27, 135|246789, 13|24568|79, 13579|268|4, 1357|2689|4, 13678|259|4, 13|259|4678, 13|2689|457, 13|268|4579, 156789|234, 18|2345679, 169|23578|4, 1789|2356|4, 178|23569|4.
a(10) = 9: 1|2356|4|78(10)|9, 1|23578|4|6(10)|9, 1|258(10)|367|4|9, 1|258(10)|36|4|79, 1|259|36|4|78(10), 1|267(10)|358|4|9, 1|268|357(10)|4|9, 1|27|3589|4|6(10), 1|27|358|4|69(10).
		

Crossrefs

Showing 1-2 of 2 results.