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.

A365381 Irregular triangle read by rows where T(n,k) is the number of subsets of {1..n} with a subset summing to k.

Original entry on oeis.org

1, 2, 1, 4, 2, 2, 1, 8, 4, 4, 5, 2, 2, 1, 16, 8, 8, 10, 10, 7, 5, 5, 2, 2, 1, 32, 16, 16, 20, 20, 23, 15, 15, 12, 12, 8, 5, 5, 2, 2, 1, 64, 32, 32, 40, 40, 46, 47, 38, 33, 35, 29, 28, 21, 17, 14, 13, 8, 5, 5, 2, 2, 1, 128, 64, 64, 80, 80, 92, 94, 102, 79, 82, 76, 75, 68, 64, 53, 48, 43, 34, 33, 23, 19, 15, 13, 8, 5, 5, 2, 2, 1
Offset: 0

Views

Author

Gus Wiseman, Sep 08 2023

Keywords

Comments

Row lengths are A000124(n) = 1 + n*(n+1)/2.

Examples

			Triangle begins:
   1
   2  1
   4  2  2  1
   8  4  4  5  2  2  1
  16  8  8 10 10  7  5  5  2  2  1
  32 16 16 20 20 23 15 15 12 12  8  5  5  2  2  1
  64 32 32 40 40 46 47 38 33 35 29 28 21 17 14 13  8  5  5  2  2  1
Array begins:
     k=0   k=1  k=2  k=3  k=4  k=5  k=6  k=7  k=8  k=9
-------------------------------------------------------
n=0:  1
n=1:  2     1
n=2:  4     2    2    1
n=3:  8     4    4    5    2    2    1
n=4:  16    8    8    10   10   7    5    5    2    2
n=5:  32    16   16   20   20   23   15   15   12   12
n=6:  64    32   32   40   40   46   47   38   33   35
n=7:  128   64   64   80   80   92   94   102  79   82
n=8:  256   128  128  160  160  184  188  204  207  184
n=9:  512   256  256  320  320  368  376  408  414  440
The T(5,8) = 12 subsets are:
  {3,5}  {1,2,5}  {1,2,3,4}  {1,2,3,4,5}
         {1,3,4}  {1,2,3,5}
         {1,3,5}  {1,2,4,5}
         {2,3,5}  {1,3,4,5}
         {3,4,5}  {2,3,4,5}
		

Crossrefs

Row lengths are A000124 = number of distinct sums of subsets of {1..n}.
Central column/main diagonal is A365376.
A000009 counts sets summing to n.
A000124 counts distinct possible sums of subsets of {1..n}.
A365046 counts combination-full subsets, differences of A364914.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],MemberQ[Total/@Subsets[#],k]&]],{n,0,8},{k,0,n*(n+1)/2}]