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-5 of 5 results.

A222807 Number of subsets A of {0,1,...,n-1} with |A+A| > |A-A|.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 10, 30, 66, 144, 314, 692, 1452, 3046, 6388, 13298, 27274, 56164, 113672, 231892, 470984, 950178, 1912700, 3868034, 7772172, 15651674, 31464544, 63154106, 126603428, 254088618, 508541874, 1018817124
Offset: 1

Views

Author

N. J. A. Sloane, Mar 10 2013

Keywords

Comments

Some authors work with subsets of [0..n-1], others with subsets of [1..n].
Keywords: sum-dominant sets, MSTD sets.
a(1)-a(21) were computed by Daniel C. R. Scheinerman, Mar 10 2013; although a(1)-a(27) had been found by Kevin O'Bryant some time earlier.

Examples

			The four examples illustrating a(15)=4 are (cf. A140794):
0    2    3    7   10   11   12   14,
0    2    3    4    7   11   12   14,
0    1    2    5    9   10   12   13   14,
0    1    2    4    5    9   12   13   14.
		

Crossrefs

Formula

a(n) = Sum_{i=1..n} (n-i+1)*A224893(i).

Extensions

a(28)-a(35) from James Wilcox, Jul 22 2013
a(36)-a(40) from Giovanni Resta, Jul 23 2013
a(41) from James Wilcox, Jul 24 2013

A118544 Number of subsets A of {1,2,...,n} with |A+A| = |A-A|.

Original entry on oeis.org

2, 4, 8, 14, 24, 40, 66, 106, 174, 286, 480, 814, 1412, 2480, 4476, 8184, 15230, 28652, 54488, 104262, 201266, 390090, 760234, 1486030, 2914492, 5728506, 11289420, 22279222, 44046072, 87181188, 172777354, 342724456, 680524908, 1352154964, 2688763324
Offset: 1

Views

Author

Kevin O'Bryant, May 07 2006

Keywords

Comments

Keywords: sum-dominant sets, MSTD sets.
Some authors work with subsets of [0..n-1], others with subsets of [1..n].

Examples

			a(4)=14: two of the sixteen subsets of {1,2,3,4} have |A+A|<|A-A| (specifically, {1,3,4} and {1,2,4}).
		

Crossrefs

Extensions

a(21)-a(29) from Robert Gerbicz, Nov 19 2010
a(30)-a(35) from James Wilcox, Jul 22 2013

A140794 One of the four smallest counterexamples to the conjecture that the cardinality of the sumset is less than or equal to the cardinality of the difference set of every finite set of integers.

Original entry on oeis.org

0, 2, 3, 7, 10, 11, 12, 14
Offset: 1

Views

Author

Jonathan Vos Post, Jul 15 2008

Keywords

Comments

This sequence is the reflection of A102282: a(n) = 14 - A102282(9-n).
Keywords: sum-dominant sets, MSTD sets.
A set with more sums than differences is called an MSTD set. Hegarty has constructed many such examples.
Comment from N. J. A. Sloane, Mar 10 2013: Out of the 2^n subsets S of [0..n-1], let
AG(n) = number of S with |S+S|>|S-S|,
AE(n) = number of S with |S+S|=|S-S|,
AL(n) = number of S with |S+S|<|S-S|.
A140794 says AG(n) = 0 for n <= 14. These three sequences are respectively A222807, A118544, A222808.

Examples

			Let A = {0, 2, 3, 7, 10, 11, 12, 14}. Then the cardinality of the sumset, |A + A| = 26, while the cardinality of the difference set, |A - A| = 25.
		

Crossrefs

Extensions

Corrected by James Wilcox, Jul 24 2013

A102282 Smallest possible example of an MSTD ("More sums than differences") set.

Original entry on oeis.org

0, 2, 3, 4, 7, 11, 12, 14
Offset: 1

Views

Author

N. J. A. Sloane, Sep 08 2008

Keywords

Comments

Reflection of A140794: a(n) = 14 - A140794(9-n). - James Wilcox, Jul 24 2013
Hegarty, who attributes the set to Conway, proves its minimality. - Charles R Greathouse IV, Sep 26 2019

References

  • B. Hayes, Calculemus!, American Scientist, 96 (Sep-Oct 2008), 362-366.

Crossrefs

A305503 Largest cardinality of subsets A of {0,1,...,n-1} with |A + A| > |A - A|.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40
Offset: 1

Views

Author

Tanuj Mathur, Jun 03 2018

Keywords

Comments

All the possible 'A's are explicitly generated and sorted according to their cardinality.

Examples

			For n = 15, the subsets A of {0,1,...,n-1} with |A + A| > |A - A| are (0, 2, 3, 4, 7, 11, 12, 14); (0, 2, 3, 7, 10, 11, 12, 14); (0, 1, 2, 4, 5, 9, 12, 13, 14) and (0, 1, 2, 5, 9, 10, 12, 13, 14). So, the largest cardinality is 9.
		

Crossrefs

Programs

  • Python
    import numpy as np
    import itertools
    def findsubsets(S, m):
        return itertools.combinations(S, m)
    def mstd(a):
        a1 = set()
        a2 = set()
        for i in a:
            for j in a:
                a1.add(i + j)
                a2.add(i - j)
        return len(a1) > len(a2)
    def a(n):
        ans = 0
        Nn = list(range(n))
        for k in range(1, n):
            if any(mstd(i) for i in findsubsets(Nn, k)):
                ans = k
        return ans

Formula

a(n) = n - 7 (conjectured) for all n > 15.
Conjectures from Colin Barker, Jun 01 2020: (Start)
G.f.: x^14*(9 - 9*x + x^2) / (1 - x)^2.
a(n) = 2*a(n-1) - a(n-2) for n>17.
(End)
Showing 1-5 of 5 results.