login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A007865 Number of sum-free subsets of {1, ..., n}. 104

%I #75 Dec 29 2022 06:23:34

%S 1,2,3,6,9,16,24,42,61,108,151,253,369,607,847,1400,1954,3139,4398,

%T 6976,9583,15456,20982,32816,45417,70109,94499,148234,200768,308213,

%U 415543,634270,849877,1311244,1739022,2630061,3540355,5344961,7051789,10747207,14158720,21295570,28188520

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

%C More precisely, subsets of {1,...,n} containing no solutions of x+y=z.

%C There are two proofs that a(n) is 2^{n/2}(1+o(1)), as Paul Erdős and I conjectured.

%C 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

%C The Sapozhenko paper has many additional references.

%C 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

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

%H Fausto A. C. Cariboni, <a href="/A007865/b007865.txt">Table of n, a(n) for n = 0..88</a>, (terms up to a(70) from Per Hakan Lundow)

%H P. J. Cameron and P. Erdős, <a href="https://www.researchgate.net/publication/247043302_On_the_number_of_sets_of_integers_with_various_properties">On the number of integers with various properties</a>, in R. A. Mullin, ed., Number Theory: Proc. First Conf. of Canad. Number Theory Assoc. Conf., Banff, De Gruyter, Berlin, 1990, pp. 61-79.

%H Steven R. Finch, <a href="http://www.people.fas.harvard.edu/~sfinch/constant/cameron/sf/sf.html">Several Problems Concerning Sum-Free Sets</a> [Broken link]

%H Steven R. Finch, <a href="http://web.archive.org/web/20010604180137/http://www.mathsoft.com/asolve/constant/cameron/cameron.html">Several Problems Concerning Sum-Free Sets</a> [From the Wayback machine]

%H Ben Green and Imre Z. Ruzsa, <a href="http://arxiv.org/abs/math/0307142">Sum-free sets in abelian groups</a>, arXiv:math/0307142 [math.CO], 2004.

%H A. A. Sapozhenko, <a href="http://dx.doi.org/10.1016/j.disc.2007.08.103">The Cameron-Erdős conjecture</a>, Discrete Math., 308 (2008), 4361-4369.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Sum-FreeSet.html">Sum-Free Set</a>

%F a(n) = A050291(n)-A088810(n) = A085489(n)-A088811(n) = A050291(n)+A085489(n)-A088813(n). - _Reinhard Zumkeller_, Oct 19 2003

%e {} has one sum-free subset, the empty set, so a(0)=1; {1} has two sum-free subsets, {} and {1}, so a(1)=2.

%e a(2) = 3: 0,1,2.

%e a(3) = 6: 0,1,2,3,13,23.

%e a(4) = 9: 0,1,2,3,4,13,14,23,34.

%p 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_

%t 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 *)

%t Timing[ n = 0; Last[ Reap[ Nest[ (++n; Sow[ Length[ # ] ]; Union[ #, Union[ #, {n} ]& /@ Select[ #, Intersection[ #, n - # ] == {} & ] ]) &, {{}}, 36 ] ] ] ] (* improved code from Paul Abbott, Nov 24 2005 *)

%t Table[Length[Select[Subsets[Range[n]],Intersection[#,Total/@Tuples[#,2]]=={}&]],{n,1,10}] (* _Gus Wiseman_, Jul 08 2019 *)

%o (PARI) \\ good only for n <= 25:

%o sumfree(v) = {for(i=1, #v, for (j=1, i, if (setsearch(v, v[i]+v[j]), return (0)););); return (1);}

%o a(n) = {my(nb = 0); forsubset(n, s, if (sumfree(Set(s)), nb++);); nb;} \\ _Michel Marcus_, Nov 08 2020

%Y See A085489 for another version.

%Y Cf. A211316, A211317, A093970, A093971 (number of sum-full subsets of 1..n).

%Y Cf. A050291, A103580, A151897, A308546, A326020, A326080, A326083.

%K nonn,nice

%O 0,2

%A _Peter J. Cameron_

%E More terms from _John W. Layman_, Oct 21 2000

%E Extended through a(35) by _Robert Israel_, Nov 16 2005

%E a(36)-a(37) from Alec Mihailovs (alec(AT)mihailovs.com) (using _Robert Israel_'s procedure), Nov 16 2005

%E a(38) from _Eric W. Weisstein_, Nov 17 2005

%E a(39)-a(42) from _Eric W. Weisstein_, Nov 28 2005, using Paul Abbott's Mathematica code

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 12:27 EDT 2024. Contains 371912 sequences. (Running on oeis4.)