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.

A367222 Number of subsets of {1..n} whose cardinality can be written as a nonnegative linear combination of the elements.

Original entry on oeis.org

1, 2, 3, 6, 12, 24, 49, 101, 207, 422, 859, 1747, 3548, 7194, 14565, 29452, 59496, 120086, 242185, 488035, 982672, 1977166, 3975508, 7989147, 16047464, 32221270, 64674453, 129775774, 260337978, 522124197, 1046911594, 2098709858, 4206361369, 8429033614, 16887728757, 33829251009, 67755866536, 135687781793, 271693909435
Offset: 0

Views

Author

Gus Wiseman, Nov 14 2023

Keywords

Examples

			The set {1,2,4} has 3 = (2)+(1) or 3 = (1+1+1) so is counted under a(4).
The a(0) = 1 through a(4) = 12 subsets:
  {}  {}   {}     {}       {}
      {1}  {1}    {1}      {1}
           {1,2}  {1,2}    {1,2}
                  {1,3}    {1,3}
                  {2,3}    {1,4}
                  {1,2,3}  {2,3}
                           {2,4}
                           {1,2,3}
                           {1,2,4}
                           {1,3,4}
                           {2,3,4}
                           {1,2,3,4}
		

Crossrefs

The following sequences count and rank integer partitions and finite sets according to whether their length is a subset-sum or linear combination of the parts. The current sequence is starred.
sum-full sum-free comb-full comb-free
-------------------------------------------
A002865 counts partitions whose length is a part, complement A229816.
A007865/A085489/A151897 count certain types of sum-free subsets.
A088809/A093971/A364534 count certain types of sum-full subsets.
A124506 appears to count combination-free subsets, differences of A326083.
A326020 counts complete subsets.
A365046 counts combination-full subsets, differences of A364914.
Triangles:
A008284 counts partitions by length, strict A008289.
A365381 counts sets with a subset summing to k, without A366320.
A365541 counts subsets containing two distinct elements summing to k.

Programs

  • Mathematica
    combs[n_,y_]:=With[{s=Table[{k,i},{k,y}, {i,0,Floor[n/k]}]}, Select[Tuples[s], Total[Times@@@#]==n&]];
    Table[Length[Select[Subsets[Range[n]], combs[Length[#], Union[#]]!={}&]], {n,0,10}]
  • Python
    from itertools import combinations
    from sympy.utilities.iterables import partitions
    def A367222(n):
        c, mlist = 1, []
        for m in range(1,n+1):
            t = set()
            for p in partitions(m):
                t.add(tuple(sorted(p.keys())))
            mlist.append([set(d) for d in t])
        for k in range(1,n+1):
            for w in combinations(range(1,n+1),k):
                ws = set(w)
                for s in mlist[k-1]:
                    if s <= ws:
                        c += 1
                        break
        return c # Chai Wah Wu, Nov 16 2023

Formula

a(n) = 2^n - A367223(n).

Extensions

a(13)-a(33) from Chai Wah Wu, Nov 15 2023
a(34)-a(38) from Max Alekseyev, Feb 25 2025