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 12 results. Next

A025582 A B_2 sequence: a(n) is the least value such that sequence increases and pairwise sums of elements are all distinct.

Original entry on oeis.org

0, 1, 3, 7, 12, 20, 30, 44, 65, 80, 96, 122, 147, 181, 203, 251, 289, 360, 400, 474, 564, 592, 661, 774, 821, 915, 969, 1015, 1158, 1311, 1394, 1522, 1571, 1820, 1895, 2028, 2253, 2378, 2509, 2779, 2924, 3154, 3353, 3590, 3796, 3997, 4296, 4432, 4778, 4850
Offset: 1

Views

Author

Keywords

Comments

a(n) is also the least value such that sequence increases and pairwise differences of distinct elements are all distinct.

Examples

			After 0, 1, a(3) cannot be 2 because 2+0 = 1+1, so a(3) = 3.
		

Crossrefs

Row 2 of A365515.
See A011185 for more information.
A010672 is a similar sequence, but there the pairwise sums of distinct elements are all distinct.

Programs

  • Python
    from itertools import count, islice
    def A025582_gen(): # generator of terms
        aset1, aset2, alist = set(), set(), []
        for k in count(0):
            bset2 = {k<<1}
            if (k<<1) not in aset2:
                for d in aset1:
                    if (m:=d+k) in aset2:
                        break
                    bset2.add(m)
                else:
                    yield k
                    alist.append(k)
                    aset1.add(k)
                    aset2 |= bset2
    A025582_list = list(islice(A025582_gen(),20)) # Chai Wah Wu, Sep 01 2023
  • Sage
    def A025582_list(n):
        a = [0]
        psums = set([0])
        while len(a) < n:
            a += [next(k for k in IntegerRange(a[-1]+1, infinity) if not any(i+k in psums for i in a+[k]))]
            psums.update(set(i+a[-1] for i in a))
        return a[:n]
    print(A025582_list(20))
    # D. S. McNeil, Feb 20 2011
    

Formula

a(n) = A005282(n) - 1. - Tyler Busby, Mar 16 2024

A051912 a(n) is the smallest integer such that the sum of any three ordered terms a(k), k <= n, is unique.

Original entry on oeis.org

0, 1, 4, 13, 32, 71, 124, 218, 375, 572, 744, 1208, 1556, 2441, 3097, 4047, 5297, 6703, 7838, 10986, 12331, 15464, 19143, 24545, 28973, 34405, 37768, 45863, 50876, 61371, 68302, 77917, 88544, 101916, 122031, 131624, 148574, 171236, 197814
Offset: 0

Views

Author

Wouter Meeussen, Dec 17 1999

Keywords

Examples

			Three terms chosen from {0,1,4} can be 0+0+0; 0+0+1; 0+1+1; 1+1+1; 0+0+4; 0+1+4; 1+1+4; 0+4+4; 1+4+4; 4+4+4 are all distinct (3*4*5/6 = 10 terms), so a(2) = 4 is the next integer of the sequence after 0 and 1.
		

Crossrefs

Row 3 of A365515.

Programs

  • Maple
    A[0]:= 0: S:= {0}: S2:= {0}: S3:= {0}:
    for i from 1 to 40 do
      for x from A[i-1] do
        if (map(t -> t+x,S2) intersect S3 = {}) and (map(t -> t+2*x, S) intersect S3 = {}) then
         A[i]:= x;
         S3:= S3 union map(t -> t+x,S2) union map(t -> t+2*x, S) union {3*x};
         S2:= S2 union map(t -> t+x, S) union {2*x};
         S:= S union {x};
         break
        fi
      od
    od:
    seq(A[i],i=0..40); # Robert Israel, Jul 01 2019
  • Mathematica
    a[0] = 0; a[1] = 1; a[n_] := a[n] = For[A0 = Array[a, n, 0]; an = a[n-1] + 1, True, an++, A1 = Append[A0, an]; A2 = Flatten[Table[A1[[{i, j, k}]], {i, 1, n+1}, {j, i, n+1}, {k, j, n+1}], 2]; A3 = Sort[Total /@ A2]; If[Length[A3] == Length[Union[A3]], Return[an]]]; Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 0, 38}] (* Jean-François Alcover, Nov 24 2016 *)
  • Python
    from itertools import count, islice
    def A051912_gen(): # generator of terms
        aset1, aset2, aset3, alist = set(), set(), set(), []
        for k in count(0):
            bset2, bset3 = {k<<1}, {3*k}
            if 3*k not in aset3:
                for d in aset1:
                    if (m:=d+(k<<1)) in aset3:
                        break
                    bset2.add(d+k)
                    bset3.add(m)
                else:
                    for d in aset2:
                        if (m:=d+k) in aset3:
                            break
                        bset3.add(m)
                    else:
                        yield k
                        alist.append(k)
                        aset1.add(k)
                        aset2 |= bset2
                        aset3 |= bset3
    A051912_list = list(islice(A051912_gen(),20)) # Chai Wah Wu, Sep 01 2023

Extensions

More terms from Naohiro Nomoto, Jul 22 2001

A365300 a(n) is the smallest nonnegative integer such that the sum of any four ordered terms a(k), k<=n (repetitions allowed), is unique.

Original entry on oeis.org

0, 1, 5, 21, 55, 153, 368, 856, 1424, 2603, 4967, 8194, 13663, 22432, 28169, 47688, 65545, 96615, 146248, 202507, 266267, 364834, 450308, 585328, 773000, 986339, 1162748, 1472659, 1993180, 2275962, 3012656, 3552307, 4590959, 5404183, 6601787, 7893270, 9340877
Offset: 1

Views

Author

Kevin O'Bryant, Aug 31 2023

Keywords

Comments

This is the greedy B_4 sequence.

Examples

			a(4) != 12 because 12+1+1+1 = 5+5+5+0.
		

Crossrefs

Programs

  • Python
    def GreedyBh(h, seed, stopat):
        A = [set() for _ in range(h+1)]
        A[1] = set(seed)    # A[i] will hold the i-fold sumset
        for j in range(2,h+1): # {2,...,h}
            for x in A[1]:
                A[j].update([x+y for y in A[j-1]])
        w = max(A[1])+1
        while w <= stopat:
            wgood = True
            for k in range(1,h):
                if wgood:
                    for j in range(k+1,h+1):
                        if wgood and (A[j].intersection([(j-k)*w + x for x in A[k]]) != set()):
                            wgood = False
            if wgood:
                A[1].add(w)
                for k in range(2,h+1): # update A[k]
                    for j in range(1,k):
                        A[k].update([(k-j)*w + x for x in A[j]])
            w += 1
            return A[1]
    GreedyBh(4,[0],10000)
    
  • Python
    from itertools import count, islice, combinations_with_replacement
    def A365300_gen(): # generator of terms
        aset, alist = set(), []
        for k in count(0):
            bset = set()
            for d in combinations_with_replacement(alist+[k],3):
                if (m:=sum(d)+k) in aset:
                    break
                bset.add(m)
            else:
                yield k
                alist.append(k)
                aset |= bset
    A365300_list = list(islice(A365300_gen(),20)) # Chai Wah Wu, Sep 01 2023

Extensions

a(27)-a(37) from Chai Wah Wu, Sep 01 2023

A365301 a(n) is the smallest nonnegative integer such that the sum of any five ordered terms a(k), k<=n (repetitions allowed), is unique.

Original entry on oeis.org

0, 1, 6, 31, 108, 366, 926, 2286, 5733, 12905, 27316, 44676, 94545, 147031, 257637, 435387, 643320, 1107715, 1760092, 2563547, 3744446, 5582657, 8089160, 11373419, 15575157, 21480927, 28569028, 40893371, 53425354, 69774260, 93548428, 119627554
Offset: 1

Views

Author

Kevin O'Bryant, Aug 31 2023

Keywords

Comments

This is the greedy B_5 sequence.

Examples

			a(4) != 20 because 20+1+1+1+1 = 6+6+6+6+0.
		

Crossrefs

Programs

  • Python
    def GreedyBh(h, seed, stopat):
        A = [set() for _ in range(h+1)]
        A[1] = set(seed)    # A[i] will hold the i-fold sumset
        for j in range(2,h+1): # {2,...,h}
            for x in A[1]:
                A[j].update([x+y for y in A[j-1]])
        w = max(A[1])+1
        while w <= stopat:
            wgood = True
            for k in range(1,h):
                if wgood:
                    for j in range(k+1,h+1):
                        if wgood and (A[j].intersection([(j-k)*w + x for x in A[k]]) != set()):
                            wgood = False
            if wgood:
                A[1].add(w)
                for k in range(2,h+1): # update A[k]
                    for j in range(1,k):
                        A[k].update([(k-j)*w + x for x in A[j]])
            w += 1
            return A[1]
    GreedyBh(5,[0],10000)
    
  • Python
    from itertools import count, islice, combinations_with_replacement
    def A365301_gen(): # generator of terms
        aset, alist = set(), []
        for k in count(0):
            bset = set()
            for d in combinations_with_replacement(alist+[k],4):
                if (m:=sum(d)+k) in aset:
                    break
                bset.add(m)
            else:
                yield k
                alist.append(k)
                aset |= bset
    A365301_list = list(islice(A365301_gen(),10)) # Chai Wah Wu, Sep 01 2023

Extensions

a(18)-a(28) from Chai Wah Wu, Sep 01 2023
a(29)-a(30) from Chai Wah Wu, Sep 10 2023
a(31)-a(32) from Chai Wah Wu, Mar 02 2024

A365302 a(n) is the smallest nonnegative integer such that the sum of any six ordered terms a(k), k<=n (repetitions allowed), is unique.

Original entry on oeis.org

0, 1, 7, 43, 154, 668, 2214, 6876, 16864, 41970, 94710, 202027, 429733, 889207, 1549511, 3238700, 5053317, 8502061, 15583775, 25070899, 40588284, 63604514
Offset: 1

Views

Author

Kevin O'Bryant, Aug 31 2023

Keywords

Comments

This is the greedy B_6 sequence.

Examples

			a(5) != 50 because 50+1+1+1+1+0 = 43+7+1+1+1+1.
		

Crossrefs

Programs

  • Python
    def GreedyBh(h, seed, stopat):
        A = [set() for _ in range(h+1)]
        A[1] = set(seed)    # A[i] will hold the i-fold sumset
        for j in range(2,h+1): # {2,...,h}
            for x in A[1]:
                A[j].update([x+y for y in A[j-1]])
        w = max(A[1])+1
        while w <= stopat:
            wgood = True
            for k in range(1,h):
                if wgood:
                    for j in range(k+1,h+1):
                        if wgood and (A[j].intersection([(j-k)*w + x for x in A[k]]) != set()):
                            wgood = False
            if wgood:
                A[1].add(w)
                for k in range(2,h+1): # update A[k]
                    for j in range(1,k):
                        A[k].update([(k-j)*w + x for x in A[j]])
            w += 1
            return A[1]
    GreedyBh(6,[0],10000)
    
  • Python
    from itertools import count, islice, combinations_with_replacement
    def A365302_gen(): # generator of terms
        aset, alist = set(), []
        for k in count(0):
            bset = set()
            for d in combinations_with_replacement(alist+[k],5):
                if (m:=sum(d)+k) in aset:
                    break
                bset.add(m)
            else:
                yield k
                alist.append(k)
                aset |= bset
    A365302_list = list(islice(A365302_gen(),10)) # Chai Wah Wu, Sep 01 2023

Extensions

a(15)-a(19) from Chai Wah Wu, Sep 01 2023
a(20)-a(22) from Chai Wah Wu, Sep 09 2023

A365303 a(n) is the smallest nonnegative integer such that the sum of any seven ordered terms a(k), k<=n (repetitions allowed), is unique.

Original entry on oeis.org

0, 1, 8, 57, 256, 1153, 4181, 14180, 47381, 115267, 307214, 737909, 1682367, 3850940, 8557010, 18311575, 37925058, 61662056
Offset: 1

Views

Author

Kevin O'Bryant, Aug 31 2023

Keywords

Comments

This is the greedy B_7 sequence.

Examples

			a(3) != 7 because 7+0+0+0+0+0+0 = 1+1+1+1+1+1+1.
		

Crossrefs

Programs

  • Python
    def GreedyBh(h, seed, stopat):
        A = [set() for _ in range(h+1)]
        A[1] = set(seed)    # A[i] will hold the i-fold sumset
        for j in range(2,h+1): # {2,...,h}
            for x in A[1]:
                A[j].update([x+y for y in A[j-1]])
        w = max(A[1])+1
        while w <= stopat:
            wgood = True
            for k in range(1,h):
                if wgood:
                    for j in range(k+1,h+1):
                        if wgood and (A[j].intersection([(j-k)*w + x for x in A[k]]) != set()):
                            wgood = False
            if wgood:
                A[1].add(w)
                for k in range(2,h+1): # update A[k]
                    for j in range(1,k):
                        A[k].update([(k-j)*w + x for x in A[j]])
            w += 1
            return A[1]
    GreedyBh(7,[0],10000)
    
  • Python
    from itertools import count, islice, combinations_with_replacement
    def A365303_gen(): # generator of terms
        aset, alist = set(), []
        for k in count(0):
            bset = set()
            for d in combinations_with_replacement(alist+[k],6):
                if (m:=sum(d)+k) in aset:
                    break
                bset.add(m)
            else:
                yield k
                alist.append(k)
                aset |= bset
    A365303_list = list(islice(A365303_gen(),10)) # Chai Wah Wu, Sep 01 2023

Extensions

a(13)-a(18) from Chai Wah Wu, Sep 13 2023

A365304 a(n) is the smallest nonnegative integer such that the sum of any eight ordered terms a(k), k<=n (repetitions allowed), is unique.

Original entry on oeis.org

0, 1, 9, 73, 333, 1822, 8043, 28296, 102042, 338447, 1054824, 2569353, 6237718, 15947108, 36179796
Offset: 1

Views

Author

Kevin O'Bryant, Aug 31 2023

Keywords

Comments

This is the greedy B_8 sequence.

Examples

			a(4) != 70 because 70+1+1+0+0+0+0+0 = 9+9+9+9+9+9+9+0.
		

Crossrefs

Programs

  • Python
    def GreedyBh(h, seed, stopat):
        A = [set() for _ in range(h+1)]
        A[1] = set(seed)    # A[i] will hold the i-fold sumset
        for j in range(2,h+1): # {2,...,h}
            for x in A[1]:
                A[j].update([x+y for y in A[j-1]])
        w = max(A[1])+1
        while w <= stopat:
            wgood = True
            for k in range(1,h):
                if wgood:
                    for j in range(k+1,h+1):
                        if wgood and (A[j].intersection([(j-k)*w + x for x in A[k]]) != set()):
                            wgood = False
            if wgood:
                A[1].add(w)
                for k in range(2,h+1): # update A[k]
                    for j in range(1,k):
                        A[k].update([(k-j)*w + x for x in A[j]])
            w += 1
            return A[1]
    GreedyBh(8,[0],10000)
    
  • Python
    from itertools import count, islice, combinations_with_replacement
    def A365304_gen(): # generator of terms
        aset, alist = set(), []
        for k in count(0):
            bset = set()
            for d in combinations_with_replacement(alist+[k],7):
                if (m:=sum(d)+k) in aset:
                    break
                bset.add(m)
            else:
                yield k
                alist.append(k)
                aset |= bset
    A365304_list = list(islice(A365304_gen(),10)) # Chai Wah Wu, Sep 01 2023

Extensions

a(11)-a(15) from Chai Wah Wu, Sep 13 2023

A365305 a(n) is the smallest nonnegative integer such that the sum of any nine ordered terms a(k), k<=n (repetitions allowed), is unique.

Original entry on oeis.org

0, 1, 10, 91, 500, 3119, 13818, 59174, 211135, 742330, 2464208, 7616100, 19241477, 56562573
Offset: 1

Views

Author

Kevin O'Bryant, Aug 31 2023

Keywords

Comments

This is the greedy B_9 sequence.

Examples

			a(4) != 72 because 72+1+1+1+1+1+1+1+1+0 = 10+10+10+10+10+10+10+10+0.
		

Crossrefs

Programs

  • Python
    def GreedyBh(h, seed, stopat):
        A = [set() for _ in range(h+1)]
        A[1] = set(seed)    # A[i] will hold the i-fold sumset
        for j in range(2,h+1): # {2,...,h}
            for x in A[1]:
                A[j].update([x+y for y in A[j-1]])
        w = max(A[1])+1
        while w <= stopat:
            wgood = True
            for k in range(1,h):
                if wgood:
                    for j in range(k+1,h+1):
                        if wgood and (A[j].intersection([(j-k)*w + x for x in A[k]]) != set()):
                            wgood = False
            if wgood:
                A[1].add(w)
                for k in range(2,h+1): # update A[k]
                    for j in range(1,k):
                        A[k].update([(k-j)*w + x for x in A[j]])
            w += 1
            return A[1]
    GreedyBh(9,[0],10000)
    
  • Python
    from itertools import count, islice, combinations_with_replacement
    def A365305_gen(): # generator of terms
        aset, alist = set(), []
        for k in count(0):
            bset = set()
            for d in combinations_with_replacement(alist+[k],8):
                if (m:=sum(d)+k) in aset:
                    break
                bset.add(m)
            else:
                yield k
                alist.append(k)
                aset |= bset
    A365305_list = list(islice(A365305_gen(),10)) # Chai Wah Wu, Sep 01 2023

Extensions

a(11)-a(14) from Chai Wah Wu, Sep 13 2023

A369817 The fifth term of the greedy B_n set of natural numbers.

Original entry on oeis.org

4, 12, 32, 55, 108, 154, 256, 333, 500, 616, 864, 1027, 1372, 1590, 2048, 2329, 2916, 3268, 4000, 4431, 5324, 5842, 6912, 7525, 8788, 9504, 10976, 11803, 13500, 14446, 16384, 17457, 19652, 20860, 23328, 24679, 27436, 28938, 32000, 33661, 37044, 38872, 42592, 44595, 48668, 50854, 55296, 57673, 62500, 65076
Offset: 1

Views

Author

Kevin O'Bryant, Feb 02 2024

Keywords

Comments

{0, 1, n+1, n^2+n+1, a(n)} is the lexicographically first set of 5 nonnegative integers with the property that the sum of any n nondecreasing terms (repetitions allowed) is unique.

Examples

			a(2) = 12, as all 15 nonincreasing sums from {0,1,3,7,12}, namely 0+0 < 0+1 < 1+1 < 0+3 < 1+3 < 3+3 < 0+7 < 1+7 < 3+7 < 0+12 < 1+12 < 7+7 < 3+12 < 7+12 < 12+12, are distinct, and all other 5-element sets of nonnegative integers with this property are lexicographically after {0,1,3,7,12}.
		

Crossrefs

Column 5 of A365515.

Programs

  • Mathematica
    a[n_] := Floor[(n + 3)/2] n^2 + Floor[(3 n + 2)/2]
  • Python
    def A369817(n): return (n+3>>1)*n**2+(3*n+2>>1) # Chai Wah Wu, Feb 28 2024

Formula

a(n) = floor((n + 3)/2) * n^2 + floor((3*n + 2)/2), proved in arXiv:2311.14021.
G.f.: x*(-x^6 + x^5 + 5*x^4 - x^3 + 8*x^2 + 8*x + 4)/((x - 1)*(x^2 - 1)^3). - Chai Wah Wu, Feb 28 2024
E.g.f.: ((2 + 7*x + 5*x^2 + x^3)*cosh(x) + (1 + 6*x + 6*x^2 + x^3)*sinh(x) - 2)/2. - Stefano Spezia, Mar 09 2024

A369818 The sixth term of the greedy B_n set of natural numbers.

Original entry on oeis.org

5, 20, 71, 153, 366, 668, 1153, 1822, 3119, 4448, 6348, 8559, 11565, 14976, 21023, 26220, 33066, 40306, 49601, 59354, 76031, 89248, 106008, 122909, 143989, 165196, 200759, 227660, 261030, 293736, 333825, 373110, 438191, 485952, 544356, 600523, 668573, 734072, 841679, 918988, 1012578, 1101374, 1208065, 1309426, 1474943, 1592000, 1732656
Offset: 1

Views

Author

Kevin O'Bryant, Feb 03 2024

Keywords

Comments

{0, 1, n+1, n^2+n+1, A369817(n), a(n)} is the lexicographically first set of 6 nonnegative integers with the property that the sum of any n nondecreasing terms (repetitions allowed) is unique.

Examples

			a(2) = 20, as all 21 nonincreasing sums from {0,1,3,7,12,20}, namely 0+0 < 0+1 < 1+1 < 0+3 < 1+3 < 3+3 < 0+7 < 1+7 < 3+7 < 0+12 < 1+12 < 7+7 < 3+12 < 7+12 < 0+20 < 1+20 < 3+20 < 12+12 < 7+20 < 12+20 < 20+20, are distinct, and all other 6-element sets of nonnegative integers with this property are lexicographically after {0,1,3,7,12,20}.
		

Crossrefs

Column 6 of A365515.
Cf. A369817.

Programs

  • Python
    from itertools import count, combinations_with_replacement
    def A369818(n):
        alist = [0,1,n+1,n*(n+1)+1,(n+3>>1)*n**2+(3*n+2>>1)]
        aset = set(sum(d) for d in combinations_with_replacement(alist,n))
        blist = []
        for i in range(n):
            blist.append(set(sum(d) for d in combinations_with_replacement(alist,i)))
        for k in count(max(alist[-1]+1,(n**3>>1)*(1+(n>>2)))):
            for i in range(n):
                if any((n-i)*k+d in aset for d in blist[i]):
                    break
            else:
                return k # Chai Wah Wu, Feb 28 2024

Formula

Conjectured that a(6n+i) is a quartic polynomial sequence with lead term (1/3)n^4 for each i in {1,2,3,5,6,10} in arxiv:2312.10910.
Proved that (1/8)*n^4 + (1/2)*n^3 <= a(n) <= 0.406671*n^4 + O(n^3) in arxiv:2312.10910.
Showing 1-10 of 12 results. Next