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.

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