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.

A096137 Table read by rows: row n contains the sum of each nonempty subset of {1, 2, ..., n}. In each row, the sums are arranged in ascending order.

Original entry on oeis.org

1, 1, 2, 3, 1, 2, 3, 3, 4, 5, 6, 1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 9, 10, 1, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 12, 12, 13, 14, 15, 1, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12
Offset: 1

Views

Author

Amarnath Murthy, Jul 06 2004

Keywords

Comments

The n-th row has 2^n-1 members. A001788 gives the row sums. The sums of the k-element subsets of {1, 2, ..., n} add up to A094305(n-1, k-1).

Examples

			The nonempty subsets of {1, 2, 3} are {1}, {2}, {3}, {1,2}, {1,3}, {2,3} and {1,2,3}, which have sums 1, 2, 3, 3, 4, 5 and 6 respectively, so these are the terms of row 3.
Triangle T(n,k) begins:
  1;
  1, 2, 3;
  1, 2, 3, 3, 4, 5, 6;
  1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 9, 10;
  ...
		

Crossrefs

Programs

  • Maple
    T:= proc(n) option remember; `if`(n=0, [][], subsop(1=[][],
          sort(map(x-> (x, x+n), [0, T(n-1)])))[])
        end:
    seq(T(n), n=1..7);  # Alois P. Heinz, Jul 24 2019
  • Mathematica
    T[n_] := T[n] = Total /@ Subsets[Range[n], {1, n}] // Sort;
    Array[T, 7] // Flatten (* Jean-François Alcover, Feb 14 2021 *)

Extensions

Edited and extended by David Wasserman, Oct 04 2007