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.

A062294 A B_2 sequence: a(n) is the smallest prime such that the pairwise sums of distinct elements are all distinct.

Original entry on oeis.org

2, 3, 5, 7, 11, 17, 29, 47, 67, 83, 131, 163, 233, 307, 397, 443, 617, 727, 809, 941, 1063, 1217, 1399, 1487, 1579, 1931, 2029, 2137, 2237, 2659, 2777, 3187, 3659, 3917, 4549, 4877, 5197, 5471, 5981, 6733, 7207, 7349, 8039, 8291, 8543, 9283, 9689, 10037
Offset: 1

Views

Author

Labos Elemer, Jul 02 2001

Keywords

Crossrefs

Programs

  • Python
    from itertools import islice
    from sympy import nextprime
    def A062294_gen(): # generator of terms
        aset2, alist, k = set(), [], 0
        while (k:=nextprime(k)):
            bset2 = set()
            for a in alist:
                if (b:=a+k) in aset2:
                    break
                bset2.add(b)
            else:
                yield k
                alist.append(k)
                aset2.update(bset2)
    A062294_list = list(islice(A062294_gen(),30)) # Chai Wah Wu, Sep 11 2023

Extensions

Edited, corrected and extended by Klaus Brockhaus, Sep 17 2007

A133097 a(n) = A005282(n) - A011185(n-1).

Original entry on oeis.org

0, 0, 1, 3, 5, 8, 10, 15, 27, 28, 23, 28, 20, 30, 22, 40, 32, 45, 27, 62, 89, 62, 116, 167, 105, 118, 108, 51, 99, 151, 88, 137, 137, 265, 174, 195, 320, 321, 249, 283, 226, 281, 293, 394, 465, 369, 585, 565, 639, 404, 483, 221, 233, 428, 384, 370, 527, 431, 818
Offset: 1

Views

Author

Klaus Brockhaus, Sep 17 2007

Keywords

Comments

Also A025582(n) - A010672(n-1).
A005282 is the sequence of smallest numbers such that the pairwise sums of not necessarily distinct elements are all distinct, whereas A011185 is the sequence of smallest numbers such that the pairwise sums of distinct elements are all distinct.
Sequence has negative terms; the first one is a(65) = -130.

Examples

			a(6) = A005282(6) - A011185(6) = 21 - 13 = 8.
		

Crossrefs

Programs

  • Python
    from itertools import count, islice
    from collections import deque
    def A133097_gen(): # generator of terms
        aset2, alist, bset2, blist, aqueue, bqueue = set(), [], set(), [], deque(), deque()
        for k in count(1):
            cset2 = {k<<1}
            if (k<<1) not in aset2:
                for a in alist:
                    if (m:=a+k) in aset2:
                        break
                    cset2.add(m)
                else:
                    aqueue.append(k)
                    alist.append(k)
                    aset2.update(cset2)
            cset2 = set()
            for b in blist:
                if (m:=b+k) in bset2:
                    break
                cset2.add(m)
            else:
                bqueue.append(k)
                blist.append(k)
                bset2.update(cset2)
            if len(aqueue) > 0 and len(bqueue) > 0:
                yield aqueue.popleft()-bqueue.popleft()
    A133097_list = list(islice(A133097_gen(),30)) # Chai Wah Wu, Sep 11 2023
Showing 1-2 of 2 results.