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.

A284249 Number T(n,k) of k-element subsets of [n] whose sum is a triangular number; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 1, 2, 3, 3, 1, 1, 1, 3, 4, 5, 3, 1, 1, 1, 3, 5, 8, 6, 4, 1, 1, 1, 3, 7, 12, 11, 9, 4, 1, 1, 1, 3, 9, 16, 20, 18, 11, 5, 1, 1, 1, 4, 10, 22, 32, 35, 26, 14, 5, 1, 1, 1, 4, 12, 29, 48, 61, 55, 36, 17, 6, 1, 1, 1, 4, 14, 37, 70, 100, 106, 84, 48, 21, 6, 1, 1
Offset: 0

Views

Author

Alois P. Heinz, Mar 23 2017

Keywords

Examples

			Triangle T(n,k) begins:
  1;
  1, 1;
  1, 1,  1;
  1, 2,  1,  1;
  1, 2,  2,  1,  1;
  1, 2,  3,  3,  1,   1;
  1, 3,  4,  5,  3,   1,   1;
  1, 3,  5,  8,  6,   4,   1,  1;
  1, 3,  7, 12, 11,   9,   4,  1,  1;
  1, 3,  9, 16, 20,  18,  11,  5,  1,  1;
  1, 4, 10, 22, 32,  35,  26, 14,  5,  1, 1;
  1, 4, 12, 29, 48,  61,  55, 36, 17,  6, 1, 1;
  1, 4, 14, 37, 70, 100, 106, 84, 48, 21, 6, 1, 1;
		

Crossrefs

Second and third lower diagonals give: A008619(n+1), A008747(n+1).
Row sums give A284250.
T(2n,n) gives A284251.

Programs

  • Maple
    b:= proc(n, s) option remember; expand(`if`(n=0,
          `if`(issqr(8*s+1), 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[8*s + 1], 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, 16}] // Flatten (*Jean-François Alcover, May 29 2018, from Maple *)

A281872 Number of sets of exactly n positive integers <= 2n having a square element sum.

Original entry on oeis.org

1, 1, 1, 3, 8, 24, 74, 238, 786, 2646, 9071, 31536, 110967, 394420, 1414053, 5107523, 18568628, 67894564, 249513890, 921134164, 3414439996, 12703212213, 47419589969, 177551521838, 666655929561, 2509526456940, 9469082269965, 35807434636137, 135681047696427
Offset: 0

Views

Author

Alois P. Heinz, Jan 31 2017

Keywords

Examples

			a(0) = 1: {}.
a(1) = 1: {1}.
a(2) = 1: {1,3}.
a(3) = 3: {1,2,6}, {1,3,5}, {2,3,4}.
a(4) = 8: {1,2,5,8}, {1,2,6,7}, {1,3,4,8}, {1,3,5,7}, {1,4,5,6}, {2,3,4,7}, {2,3,5,6}, {4,6,7,8}.
		

Crossrefs

Formula

a(n) = A281871(2n,n).
Showing 1-2 of 2 results.