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

A365515 Table read by antidiagonals upward: the n-th row gives the lexicographically earliest infinite B_n sequence starting from 0.

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 0, 1, 3, 3, 0, 1, 4, 7, 4, 0, 1, 5, 13, 12, 5, 0, 1, 6, 21, 32, 20, 6, 0, 1, 7, 31, 55, 71, 30, 7, 0, 1, 8, 43, 108, 153, 124, 44, 8, 0, 1, 9, 57, 154, 366, 368, 218, 65, 9, 0, 1, 10, 73, 256, 668, 926, 856, 375, 80, 10, 0, 1, 11, 91, 333, 1153, 2214, 2286, 1424, 572, 96, 11
Offset: 1

Views

Author

Chai Wah Wu, Sep 07 2023

Keywords

Comments

A B_n sequence is a sequence such that all sums a(x_1) + a(x_2) + ... + a(x_n) are distinct for 1 <= x_1 <= x_2 <= ... <= x_n. Analogous to A347570 except that here the B_n sequences start from a(1) = 0.

Examples

			Table begins:
n\k | 1  2   3   4    5     6      7      8       9
----+---------------------------------------------------
  1 | 0, 1,  2,  3,   4,    5,     6,     7,      8, ...
  2 | 0, 1,  3,  7,  12,   20,    30,    44,     65, ...
  3 | 0, 1,  4, 13,  32,   71,   124,   218,    375, ...
  4 | 0, 1,  5, 21,  55,  153,   368,   856,   1424, ...
  5 | 0, 1,  6, 31, 108,  366,   926,  2286,   5733, ...
  6 | 0, 1,  7, 43, 154,  668,  2214,  6876,  16864, ...
  7 | 0, 1,  8, 57, 256, 1153,  4181, 14180,  47381, ...
  8 | 0, 1,  9, 73, 333, 1822,  8043, 28296, 102042, ...
  9 | 0, 1, 10, 91, 500, 3119, 13818, 59174, 211135, ...
		

Crossrefs

Cf. A001477 (n=1), A025582 (n=2), A051912 (n=3), A365300 (n=4), A365301 (n=5), A365302 (n=6), A365303 (n=7), A365304 (n=8), A365305 (n=9), A002061 (k=4), A369817 (k=5), A369818 (k=6), A369819 (k=7), A347570.

Programs

  • Python
    from itertools import count, islice, combinations_with_replacement
    def A365515_gen(): # generator of terms
        asets, alists, klist = [set()], [[]], [0]
        while True:
            for i in range(len(klist)-1,-1,-1):
                kstart, alist, aset = klist[i], alists[i], asets[i]
                for k in count(kstart):
                    bset = set()
                    for d in combinations_with_replacement(alist+[k],i):
                        if (m:=sum(d)+k) in aset:
                            break
                        bset.add(m)
                    else:
                        yield k
                        alists[i].append(k)
                        klist[i] = k+1
                        asets[i].update(bset)
                        break
            klist.append(0)
            asets.append(set())
            alists.append([])
    A365515_list = list(islice(A365515_gen(),30))

Formula

a(n) = A347570(n)-1.

A369819 The seventh term of the greedy B_n set of natural numbers.

Original entry on oeis.org

6, 30, 124, 368, 926, 2214, 4181, 8043, 13818, 23614, 34825, 54011, 84026, 109870, 156474, 217790, 304910, 376260, 510220, 667130, 794873, 1008048, 1302947, 1629264, 1916949, 2361150, 2859694, 3467661, 3989744, 4779270, 5479857, 6449983, 7575912
Offset: 1

Views

Author

Kevin O'Bryant, Feb 03 2024

Keywords

Comments

Proved in arXiv:2312.10910 that a(n) <= 0.382978*n^5 + O(n^4).

Examples

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

Crossrefs

Column 7 of A365515.

Programs

  • Python
    # uses Python code from A369818
    from itertools import count, combinations_with_replacement
    def A369819(n):
        alist = [0,1,n+1,n*(n+1)+1,(n+3>>1)*n**2+(3*n+2>>1),A369818(n)]
        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(alist[-1]+1):
            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
Showing 1-2 of 2 results.