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-10 of 74 results. Next

A007865 Number of sum-free subsets of {1, ..., n}.

Original entry on oeis.org

1, 2, 3, 6, 9, 16, 24, 42, 61, 108, 151, 253, 369, 607, 847, 1400, 1954, 3139, 4398, 6976, 9583, 15456, 20982, 32816, 45417, 70109, 94499, 148234, 200768, 308213, 415543, 634270, 849877, 1311244, 1739022, 2630061, 3540355, 5344961, 7051789, 10747207, 14158720, 21295570, 28188520
Offset: 0

Views

Author

Keywords

Comments

More precisely, subsets of {1,...,n} containing no solutions of x+y=z.
There are two proofs that a(n) is 2^{n/2}(1+o(1)), as Paul Erdős and I conjectured.
In sumset notation, number of subsets A of {1,...,n} such that the intersection of A and 2A is empty. Using the Mathematica program, all such subsets can be printed. - T. D. Noe, Apr 20 2004
The Sapozhenko paper has many additional references.
If this sequence counts sum-free sets, then A326083 counts sum-closed sets, which is different from sum-full sets (A093971). - Gus Wiseman, Jul 08 2019

Examples

			{} has one sum-free subset, the empty set, so a(0)=1.
{1} has two sum-free subsets, {} and {1}, so a(1)=2.
a(2) = 3: 0,1,2.
a(3) = 6: 0,1,2,3,13,23.
a(4) = 9: 0,1,2,3,4,13,14,23,34.
		

References

  • S. R. Finch, Mathematical Constants, Cambridge, 2003, pp. 180-183.

Crossrefs

See A085489 for another version.
Cf. A211316, A211317, A093970, A093971 (number of sum-full subsets of 1..n).

Programs

  • Maple
    S3S:= {{}}: a[0]:= 1: for n from 1 to 35 do S3S:= S3S union map(t -> t union {n}, select(t -> (t intersect map(q -> n-q,t)={}),S3S)); a[n]:= nops(S3S) od: seq(a[n],n=0..35); # Code for computing (the number of) sum-free subsets of {1, ..., n} - Robert Israel
  • Mathematica
    SumFreeSet[ 0 ] = {{}}; SumFreeSet[ n_ ] := SumFreeSet[ n ] = Union[ SumFreeSet[ n - 1 ], Union[ #, {n} ] & /@ Select[ SumFreeSet[ n - 1 ], Intersection[ #, n - # ] == {} & ] ] As a check, enter Length /@ SumFreeSet /@ Range[ 0, 30 ] Alternatively, use NestList. n = 0; Length /@ NestList[ (++n; Union[ #, Union[ #, {n} ] & /@ Select[ #, Intersection[ #, n - # ] == {} & ] ]) &, {{}}, 30 ] (* from Paul Abbott, based on Robert Israel's Maple code *)
    Timing[ n = 0; Last[ Reap[ Nest[ (++n; Sow[ Length[ # ] ]; Union[ #, Union[ #, {n} ]& /@ Select[ #, Intersection[ #, n - # ] == {} & ] ]) &, {{}}, 36 ] ] ] ] (* improved code from Paul Abbott, Nov 24 2005 *)
    Table[Length[Select[Subsets[Range[n]],Intersection[#,Total/@Tuples[#,2]]=={}&]],{n,1,10}] (* Gus Wiseman, Jul 08 2019 *)
  • PARI
    \\ good only for n <= 25:
    sumfree(v) = {for(i=1, #v, for (j=1, i, if (setsearch(v, v[i]+v[j]), return (0)););); return (1);}
    a(n) = {my(nb = 0); forsubset(n, s, if (sumfree(Set(s)), nb++);); nb;} \\ Michel Marcus, Nov 08 2020

Formula

a(n) = A050291(n)-A088810(n) = A085489(n)-A088811(n) = A050291(n)+A085489(n)-A088813(n). - Reinhard Zumkeller, Oct 19 2003

Extensions

More terms from John W. Layman, Oct 21 2000
Extended through a(35) by Robert Israel, Nov 16 2005
a(36)-a(37) from Alec Mihailovs (alec(AT)mihailovs.com) (using Robert Israel's procedure), Nov 16 2005
a(38) from Eric W. Weisstein, Nov 17 2005
a(39)-a(42) from Eric W. Weisstein, Nov 28 2005, using Paul Abbott's Mathematica code

A326083 Number of subsets of {1..n} containing all of their pairwise sums <= n.

Original entry on oeis.org

1, 2, 3, 5, 7, 12, 16, 27, 37, 58, 80, 131, 171, 277, 380, 580, 785, 1250, 1655, 2616, 3516, 5344, 7257, 11353, 14931, 23204, 31379, 47511, 63778, 98681, 130503, 201357, 270038, 407429, 548090, 840171, 1110429, 1701872, 2284325, 3440337, 4601656
Offset: 0

Views

Author

Gus Wiseman, Jun 05 2019

Keywords

Comments

The summands are allowed to be equal. The case where they must be distinct is A326080. If A007865 counts sum-free sets, this sequence counts sum-closed sets. This is different from sum-full sets (A093971).
From Gus Wiseman, Jul 08 2019: (Start)
Also the number of subsets of {1..n} containing no sum of any multiset of the elements. For example, the a(0) = 1 through a(6) = 16 subsets are:
{} {} {} {} {} {} {}
{1} {1} {1} {1} {1} {1}
{2} {2} {2} {2} {2}
{3} {3} {3} {3}
{2,3} {4} {4} {4}
{2,3} {5} {5}
{3,4} {2,3} {6}
{2,5} {2,3}
{3,4} {2,5}
{3,5} {3,4}
{4,5} {3,5}
{3,4,5} {4,5}
{4,6}
{5,6}
{3,4,5}
{4,5,6}
(End)

Examples

			The a(0) = 1 through a(6) = 16 subsets:
  {}  {}   {}     {}       {}         {}           {}
      {1}  {2}    {2}      {3}        {3}          {4}
           {1,2}  {3}      {4}        {4}          {5}
                  {2,3}    {2,4}      {5}          {6}
                  {1,2,3}  {3,4}      {2,4}        {3,6}
                           {2,3,4}    {3,4}        {4,5}
                           {1,2,3,4}  {3,5}        {4,6}
                                      {4,5}        {5,6}
                                      {2,4,5}      {2,4,6}
                                      {3,4,5}      {3,4,6}
                                      {2,3,4,5}    {3,5,6}
                                      {1,2,3,4,5}  {4,5,6}
                                                   {2,4,5,6}
                                                   {3,4,5,6}
                                                   {2,3,4,5,6}
                                                   {1,2,3,4,5,6}
The a(7) = 27 subsets:
  {}  {4}  {36}  {246}  {2467}  {24567}  {234567}  {1234567}
      {5}  {45}  {356}  {3467}  {34567}
      {6}  {46}  {367}  {3567}
      {7}  {47}  {456}  {4567}
           {56}  {457}
           {57}  {467}
           {67}  {567}
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],SubsetQ[#,Select[Plus@@@Tuples[#,2],#<=n&]]&]],{n,0,10}]

Formula

For n > 0, a(n) = A103580(n) + 1.

A364272 Number of strict integer partitions of n containing the sum of some subset of the parts. A variation of sum-full strict partitions.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1, 4, 3, 8, 6, 11, 10, 17, 16, 26, 25, 39, 39, 54, 60, 82, 84, 116, 126, 160, 177, 222, 242, 302, 337, 402, 453, 542, 601, 722, 803, 936, 1057, 1234, 1373, 1601, 1793, 2056, 2312, 2658, 2950, 3395, 3789, 4281, 4814, 5452, 6048
Offset: 0

Views

Author

Gus Wiseman, Aug 01 2023

Keywords

Comments

First differs from A316402 at a(16) = 11 due to (7,5,3,1).

Examples

			The a(6) = 1 through a(16) = 11 partitions (A=10):
  (321) . (431) . (532)  (5321) (642)  (5431) (743)  (6432)  (853)
                  (541)         (651)  (6421) (752)  (6531)  (862)
                  (4321)        (5421) (7321) (761)  (7431)  (871)
                                (6321)        (5432) (7521)  (6532)
                                              (6431) (9321)  (6541)
                                              (6521) (54321) (7432)
                                              (7421)         (7621)
                                              (8321)         (8431)
                                                             (8521)
                                                             (A321)
                                                             (64321)
		

Crossrefs

The non-strict complement is A237667, ranks A364531.
The non-strict version is A237668, ranks A364532.
The complement in strict partitions is A364349, binary A364533.
The linear combination-free version is A364350.
For subsets of {1..n} we have A364534, complement A151897.
The binary version is A364670, allowing re-used parts A363226.
A000041 counts integer partitions, strict A000009.
A008284 counts partitions by length, strict A008289.
A108917 counts knapsack partitions, strict A275972, ranks A299702.
A236912 counts binary sum-free partitions, complement A237113.
A323092 counts double-free partitions, ranks A320340.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n], UnsameQ@@#&&Intersection[#, Total/@Subsets[#,{2,Length[#]}]]!={}&]],{n,0,30}]

A151897 Number of subsets of {1, 2, ..., n} such that no member is a sum of distinct other members.

Original entry on oeis.org

1, 2, 4, 7, 13, 22, 37, 60, 100, 155, 249, 381, 591, 889, 1365, 2009, 3047, 4453, 6602, 9567, 14151, 20228, 29654, 42302, 61369, 87108, 126066, 177580, 256039, 360304, 515740, 724069, 1036860, 1448746, 2069526, 2893311, 4117725, 5749540, 8186555
Offset: 0

Views

Author

David Wasserman, Apr 16 2008

Keywords

Comments

This sequence and A085489 first differ at n = 7. a(7) = 60, A085489(7) = 61. A085489(7) includes {1, 2, 4, 7}, which is excluded from a(7) because 1+2+4 = 7.
If this sequence counts sum-free sets, A326080 counts sum-closed sets, which are different from sum-full sets (A093971). - Gus Wiseman, Jun 07 2019

Examples

			a(4) = 13, including all subsets of {1, 2, 3, 4} except {1, 2, 3} (excluded
because 1+2 = 3), {1, 3, 4} (excluded because 1+3 = 4), and {1, 2, 3, 4} (excluded for both reasons.)
From _Gus Wiseman_, Jun 07 2019: (Start)
The a(0) = 1 through a(4) = 13 subsets:
  {}  {}   {}     {}     {}
      {1}  {1}    {1}    {1}
           {2}    {2}    {2}
           {1,2}  {3}    {3}
                  {1,2}  {4}
                  {1,3}  {1,2}
                  {2,3}  {1,3}
                         {1,4}
                         {2,3}
                         {2,4}
                         {3,4}
                         {1,2,4}
                         {2,3,4}
(End)
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],Intersection[#,Plus@@@Subsets[#,{2,Length[#]}]]=={}&]],{n,0,10}] (* Gus Wiseman, Jun 07 2019 *)

Extensions

a(0) = 1 prepended by Gus Wiseman, Jun 07 2019

A237113 Number of partitions of n such that some part is a sum of two other parts.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 3, 3, 8, 10, 17, 22, 37, 47, 71, 91, 133, 170, 236, 301, 408, 515, 686, 860, 1119, 1401, 1798, 2232, 2829, 3495, 4378, 5381, 6682, 8165, 10060, 12238, 14958, 18116, 22018, 26533, 32071, 38490, 46265, 55318, 66193, 78843, 93949, 111503, 132326
Offset: 0

Views

Author

Clark Kimberling, Feb 04 2014

Keywords

Comments

These are partitions containing the sum of some 2-element submultiset of the parts, a variation of binary sum-full partitions where parts cannot be re-used, ranked by A364462. The complement is counted by A236912. The non-binary version is A237668. For re-usable parts we have A363225. - Gus Wiseman, Aug 10 2023

Examples

			Of the 11 partitions of 6, only these 3 include a part that is a sum of two other parts: [3,2,1], [2,2,1,1], [2,1,1,1,1].  Thus, a(6) = 3.
From _Gus Wiseman_, Aug 09 2023: (Start)
The a(0) = 0 through a(9) = 10 partitions:
  .  .  .  .  (211)  (2111)  (321)    (3211)    (422)      (3321)
                             (2211)   (22111)   (431)      (4221)
                             (21111)  (211111)  (3221)     (4311)
                                                (4211)     (5211)
                                                (22211)    (32211)
                                                (32111)    (42111)
                                                (221111)   (222111)
                                                (2111111)  (321111)
                                                           (2211111)
                                                           (21111111)
(End)
		

Crossrefs

The complement for subsets is A085489, with re-usable parts A007865.
For subsets of {1..n} we have A088809, with re-usable parts A093971.
The complement is counted by A236912, ranks A364461.
The non-binary complement is A237667, ranks A364531.
The non-binary version is A237668, ranks A364532.
With re-usable parts we have A363225, ranks A364348.
The complement with re-usable parts is A364345, ranks A364347.
These partitions have ranks A364462.
The strict case is A364670, with re-usable parts A363226.
A000041 counts integer partitions, strict A000009.
A008284 counts partitions by length, strict A008289.
A108917 counts knapsack partitions, ranks A299702.
A323092 counts double-free partitions, ranks A320340.

Programs

  • Mathematica
    z = 20; t = Map[Count[Map[Length[Cases[Map[Total[#] &, Subsets[#, {2}]],  Apply[Alternatives, #]]] &, IntegerPartitions[#]], 0] &, Range[z]] (* A236912 *)
    u = PartitionsP[Range[z]] - t  (* A237113, Peter J. C. Moses, Feb 03 2014 *)
    Table[Length[Select[IntegerPartitions[n],Intersection[#,Total/@Subsets[#,{2}]]!={}&]],{n,0,30}] (* Gus Wiseman, Aug 09 2023 *)

Formula

a(n) = A000041(n) - A236912(n).

Extensions

a(0)=0 prepended by Alois P. Heinz, Sep 17 2023

A088809 Number of subsets of {1, ..., n} that are not sum-free.

Original entry on oeis.org

0, 0, 0, 1, 3, 10, 27, 67, 154, 350, 763, 1638, 3450, 7191, 14831, 30398, 61891, 125557, 253841, 511818, 1029863, 2069341, 4153060, 8327646, 16687483, 33422562, 66916342, 133936603, 268026776, 536277032, 1072886163, 2146245056, 4293187682, 8587371116
Offset: 0

Views

Author

Reinhard Zumkeller, Oct 19 2003

Keywords

Comments

a(n) = 2^n - A085489(n); a non-sum-free subset contains at least one subset {u,v, w} with w=u+v.
A variation of binary sum-full sets where parts cannot be re-used, this sequence counts subsets of {1..n} with an element equal to the sum of two distinct others. The complement is counted by A085489. The non-binary version is A364534. For re-usable parts we have A093971. - Gus Wiseman, Aug 10 2023

Examples

			From _Gus Wiseman_, Aug 10 2023: (Start)
The set S = {1,3,6,8} has pair-sums {4,7,9,11,14}, which are all missing from S, so it is not counted under a(8).
The set {1,4,6,7} has pair-sum 1 + 6 = 7, so is counted under a(7).
The a(1) = 0 through a(5) = 10 sets:
  .  .  {1,2,3}  {1,2,3}    {1,2,3}
                 {1,3,4}    {1,3,4}
                 {1,2,3,4}  {1,4,5}
                            {2,3,5}
                            {1,2,3,4}
                            {1,2,3,5}
                            {1,2,4,5}
                            {1,3,4,5}
                            {2,3,4,5}
                            {1,2,3,4,5}
(End)
		

Crossrefs

The complement is counted by A085489, differences A364755.
With re-usable parts we have A093971, for partitions A363225.
The complement for partitions is A236912:
non-binary A237667,
ranks A364461,
strict A364533.
The version for partitions is A237113:
non-binary A237668,
ranks A364462,
strict A364670.
The non-binary version is A364534, complement A151897.
First differences are A364756.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],Intersection[#,Total/@Subsets[#,{2}]]!={}&]],{n,0,10}] (* Gus Wiseman, Aug 10 2023 *)

Extensions

Terms a(32) and beyond from Fausto A. C. Cariboni, Sep 28 2020

A365543 Triangle read by rows where T(n,k) is the number of integer partitions of n with a submultiset summing to k.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 3, 2, 2, 3, 5, 3, 3, 3, 5, 7, 5, 5, 5, 5, 7, 11, 7, 8, 6, 8, 7, 11, 15, 11, 11, 11, 11, 11, 11, 15, 22, 15, 17, 15, 14, 15, 17, 15, 22, 30, 22, 23, 23, 22, 22, 23, 23, 22, 30, 42, 30, 33, 30, 33, 25, 33, 30, 33, 30, 42
Offset: 0

Views

Author

Gus Wiseman, Sep 16 2023

Keywords

Comments

Rows are palindromic.

Examples

			Triangle begins:
   1
   1   1
   2   1   2
   3   2   2   3
   5   3   3   3   5
   7   5   5   5   5   7
  11   7   8   6   8   7  11
  15  11  11  11  11  11  11  15
  22  15  17  15  14  15  17  15  22
  30  22  23  23  22  22  23  23  22  30
  42  30  33  30  33  25  33  30  33  30  42
  56  42  45  44  44  43  43  44  44  45  42  56
  77  56  62  58  62  56  53  56  62  58  62  56  77
Row n = 6 counts the following partitions:
  (6)       (51)      (42)      (33)      (42)      (51)      (6)
  (51)      (411)     (411)     (321)     (411)     (411)     (51)
  (42)      (321)     (321)     (3111)    (321)     (321)     (42)
  (411)     (3111)    (3111)    (2211)    (3111)    (3111)    (411)
  (33)      (2211)    (222)     (21111)   (222)     (2211)    (33)
  (321)     (21111)   (2211)    (111111)  (2211)    (21111)   (321)
  (3111)    (111111)  (21111)             (21111)   (111111)  (3111)
  (222)               (111111)            (111111)            (222)
  (2211)                                                      (2211)
  (21111)                                                     (21111)
  (111111)                                                    (111111)
		

Crossrefs

Columns k = 0 and k = n are A000041.
Central column n = 2k is A002219.
The complement is counted by A046663, strict A365663.
Row sums are A304792.
For subsets instead of partitions we have A365381.
The strict case is A365661.
A000009 counts subsets summing to n.
A000124 counts distinct possible sums of subsets of {1..n}.
A364272 counts sum-full strict partitions, sum-free A364349.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],MemberQ[Total/@Subsets[#],k]&]],{n,0,15},{k,0,n}]

A046663 Triangle: T(n,k) = number of partitions of n (>=2) with no subsum equal to k (1 <= k <= n-1).

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 4, 3, 5, 3, 4, 4, 4, 4, 4, 4, 4, 7, 5, 7, 8, 7, 5, 7, 8, 7, 7, 8, 8, 7, 7, 8, 12, 9, 12, 9, 17, 9, 12, 9, 12, 14, 11, 12, 12, 13, 13, 12, 12, 11, 14, 21, 15, 19, 15, 21, 24, 21, 15, 19, 15, 21, 24, 19, 20, 19, 21, 22, 22, 21, 19, 20, 19, 24, 34, 23, 30, 24, 30, 25, 46, 25, 30, 24, 30, 23, 34
Offset: 2

Views

Author

Keywords

Examples

			For n = 4 there are two partitions (4, 2+2) with no subsum equal to 1, two (4, 3+1) with no subsum equal to 2 and two (4, 2+2) with no subsum equal to 3.
Triangle T(n,k) begins:
   1;
   1,  1;
   2,  2,  2;
   2,  2,  2,  2;
   4,  3,  5,  3,  4;
   4,  4,  4,  4,  4,  4;
   7,  5,  7,  8,  7,  5,  7;
   8,  7,  7,  8,  8,  7,  7,  8;
  12,  9, 12,  9, 17,  9, 12,  9, 12;
  ...
From _Gus Wiseman_, Oct 11 2023: (Start)
Row n = 8 counts the following partitions:
  (8)     (8)    (8)     (8)     (8)     (8)    (8)
  (62)    (71)   (71)    (71)    (71)    (71)   (62)
  (53)    (53)   (62)    (62)    (62)    (53)   (53)
  (44)    (44)   (611)   (611)   (611)   (44)   (44)
  (422)   (431)  (44)    (53)    (44)    (431)  (422)
  (332)          (422)   (521)   (422)          (332)
  (2222)         (2222)  (5111)  (2222)         (2222)
                         (332)
(End)
		

Crossrefs

Column k = 0 and diagonal k = n are both A002865.
Central diagonal n = 2k is A006827.
The complement with expanded domain is A365543.
The strict case is A365663, complement A365661.
Row sums are A365918, complement A304792.
For subsets instead of partitions we have A366320, complement A365381.
A000041 counts integer partitions, strict A000009.
A276024 counts distinct subset-sums of partitions.
A364272 counts sum-full strict partitions, sum-free A364349.

Programs

  • Maple
    g:= proc(n, i) option remember;
         `if`(n=0, 1, `if`(i>1, g(n, i-1), 0)+`if`(i>n, 0, g(n-i, i)))
        end:
    b:= proc(n, i, s) option remember;
         `if`(0 in s or n in s, 0, `if`(n=0 or s={}, g(n, i),
         `if`(i<1, 0, b(n, i-1, s)+`if`(i>n, 0, b(n-i, i,
          select(y-> 0<=y and y<=n-i, map(x-> [x, x-i][], s)))))))
        end:
    T:= (n, k)-> b(n, n, {min(k, n-k)}):
    seq(seq(T(n, k), k=1..n-1), n=2..16);  # Alois P. Heinz, Jul 13 2012
  • Mathematica
    g[n_, i_] := g[n, i] = If[n == 0, 1, If[i > 1, g[n, i-1], 0] + If[i > n, 0, g[n-i, i]]]; b[n_, i_, s_] := b[n, i, s] = If[MemberQ[s, 0 | n], 0, If[n == 0 || s == {}, g[n, i], If[i < 1, 0, b[n, i-1, s] + If[i > n, 0, b[n-i, i, Select[Flatten[s /. x_ :> {x, x-i}], 0 <= # <= n-i &]]]]]]; t[n_, k_] := b[n, n, {Min[k, n-k]}]; Table[t[n, k], {n, 2, 16}, {k, 1, n-1}] // Flatten (* Jean-François Alcover, Aug 20 2013, translated from Maple *)
    Table[Length[Select[IntegerPartitions[n],FreeQ[Total/@Subsets[#],k]&]],{n,2,10},{k,1,n-1}] (* Gus Wiseman, Oct 11 2023 *)

Extensions

Corrected and extended by Don Reble, Nov 04 2001

A364534 Number of subsets of {1..n} containing some element equal to the sum of two or more distinct other elements. A variation of sum-full subsets without re-used elements.

Original entry on oeis.org

0, 0, 0, 1, 3, 10, 27, 68, 156, 357, 775, 1667, 3505, 7303, 15019, 30759, 62489, 126619, 255542, 514721, 1034425, 2076924, 4164650, 8346306, 16715847, 33467324, 66982798, 134040148, 268179417, 536510608, 1073226084, 2146759579, 4293930436, 8588485846, 17177799658
Offset: 0

Views

Author

Gus Wiseman, Aug 02 2023

Keywords

Examples

			The a(0) = 0 through a(5) = 10 subsets:
  .  .  .  {1,2,3}  {1,2,3}    {1,2,3}
                    {1,3,4}    {1,3,4}
                    {1,2,3,4}  {1,4,5}
                               {2,3,5}
                               {1,2,3,4}
                               {1,2,3,5}
                               {1,2,4,5}
                               {1,3,4,5}
                               {2,3,4,5}
                               {1,2,3,4,5}
		

Crossrefs

The binary version is A088809, complement A085489.
The complement is counted by A151897.
The complement for partitions is A237667, ranks A364531.
For partitions we have A237668, ranks A364532.
For strict partitions we have A364272, complement A364349.
A108917 counts knapsack partitions, strict A275972.
A236912 counts sum-free partitions w/o re-used parts, complement A237113.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],Intersection[#,Total/@Subsets[#,{2,Length[#]}]]!={}&]],{n,0,10}]

Formula

a(n) = 2^n - A151897(n). - Andrew Howroyd, Jan 27 2024

Extensions

a(16)-a(25) from Chai Wah Wu, Nov 14 2023
a(26) onwards (using A151897) added by Andrew Howroyd, Jan 27 2024

A364914 Number of subsets of {1..n} such that some element can be written as a nonnegative linear combination of the others.

Original entry on oeis.org

0, 0, 1, 3, 9, 20, 48, 101, 219, 454, 944, 1917, 3925, 7915, 16004, 32188, 64751, 129822, 260489, 521672, 1045060, 2091808, 4187047, 8377255, 16762285, 33531228, 67077485, 134170217, 268371678, 536772231, 1073611321, 2147282291, 4294697258, 8589527163, 17179321094
Offset: 0

Views

Author

Gus Wiseman, Aug 17 2023

Keywords

Comments

A variation of non-binary combination-full sets where parts can be re-used. The complement is counted by A326083. The binary version is A093971. For non-re-usable parts we have A364534. First differences are A365046.

Examples

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

Crossrefs

The binary complement is A007865.
The binary version without re-usable parts is A088809.
The binary version is A093971.
The complement without re-usable parts is A151897.
The complement is counted by A326083.
The version without re-usable parts is A364534.
The version for strict partitions is A364839, complement A364350.
The version for partitions is A364913.
The version for positive combinations is A365043, complement A365044.
First differences are A365046.

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]],Or@@Table[combs[#[[k]],Delete[#,k]]!={},{k,Length[#]}]&]],{n,0,10}]
  • Python
    from itertools import combinations
    from sympy.utilities.iterables import partitions
    def A364914(n):
        c, mlist = 0, []
        for m in range(1,n+1):
            t = set()
            for p in partitions(m,k=m-1):
                t.add(tuple(sorted(p.keys())))
            mlist.append([set(d) for d in t])
        for k in range(2,n+1):
            for w in combinations(range(1,n+1),k):
                ws = set(w)
                for d in w:
                    for s in mlist[d-1]:
                        if s <= ws:
                            c += 1
                            break
                    else:
                        continue
                    break
        return c # Chai Wah Wu, Nov 17 2023

Extensions

a(12)-a(34) from Chai Wah Wu, Nov 17 2023
Showing 1-10 of 74 results. Next