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

A133096 a(n) = A079848(n) - A062294(n).

Original entry on oeis.org

0, 0, 0, 4, 12, 20, 18, 50, 34, 66, 80, 70, 120, 76, 90, 198, 140, 70, 110, 156, 100, 164, 10, -6, 198, 66, 258, 280, 732, 390, 594, 342, 270, 314, 210, 402, 252, 246, -28, -204, -224, 234, 14, 528, 500, 850, 1110, 942, 1014, 1542, 1906, 1416, 1034, 1454, 970, 982, 1518
Offset: 1

Views

Author

Klaus Brockhaus, Sep 17 2007

Keywords

Comments

A079848 is the sequence of smallest primes such that the pairwise sums of not necessarily distinct elements are all distinct, whereas A062294 is the sequence of smallest primes such that the pairwise sums of distinct elements are all distinct.

Examples

			a(6) = A079848(6) - A062294(6) = 37 - 17 = 20.
		

Crossrefs

Programs

  • Python
    from collections import deque
    from itertools import islice
    from sympy import nextprime
    def A133096_gen(): # generator of terms
        aset2, alist, bset2, blist, aqueue, bqueue, k = set(), [], set(), [], deque(), deque(), 1
        while (k:=nextprime(k)):
            cset2 = set()
            for a in alist:
                if (m:=k-a) 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()
    A133096_list = list(islice(A133096_gen(),30)) # Chai Wah Wu, Sep 11 2023

A079849 First differences of A079848.

Original entry on oeis.org

1, 2, 6, 12, 14, 10, 50, 4, 48, 62, 22, 120, 30, 104, 154, 116, 40, 122, 178, 66, 218, 28, 72, 296, 220, 290, 130, 552, 80, 322, 158, 400, 302, 528, 520, 170, 268, 236, 576, 454, 600, 470, 766, 224, 1090, 666, 180, 764, 868, 606, 572, 294, 738, 70, 918, 1122, 1196
Offset: 1

Views

Author

Amarnath Murthy, Feb 18 2003

Keywords

Crossrefs

Cf. A079848.

Programs

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

Extensions

Extended by Ray Chandler, Feb 11 2007

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

A135257 Smallest semiprimes such that a(j) - a(k) are all different.

Original entry on oeis.org

4, 6, 9, 10, 21, 34, 55, 65, 74, 94, 141, 177, 203, 219, 298, 321, 395, 403, 529, 581, 635, 662, 731, 934, 982, 1073, 1145, 1317, 1418, 1762, 1769, 1849, 1915, 2066, 2165, 2305, 2327, 2746, 2809, 3127, 3409, 3859, 3983, 4138, 4285, 4559, 4742, 5186, 5299, 5854
Offset: 1

Views

Author

Jonathan Vos Post, Dec 01 2007

Keywords

Comments

Semiprime analog of A079848. This is the slowest-growing semiprime B2 sequence (see A005282). The difference set through a(n) must have cardinality exactly C(n,2) = n*(n+1)/2 = A000217(n-1).

Examples

			a(1) = 4, the smallest semiprime (A001358(1)).
a(2) = 6 = A001358(2); the difference set so far is {2}.
a(3) = 9 = A001358(3); the difference set so far is {2,3,5}.
a(4) = 10 = A001358(4); the difference set so far is {1,2,3,4,5,6}.
a(5) can't be 14 = A001358(5) because 14-10 =4, in the difference set through a(4); can't be 15 = A001358(6) because 15-10 =5, in the difference set through a(4)...
a(5) = 21 = A001358(7); the difference set so far is {1,2,3,4,5,6,11,12,15,17}.
a(6) = 34 = A001358(12); the difference set so far is {1,2,3,4,5,6,11,12,13,15,17,24,25,28,30}.
		

Crossrefs

Programs

  • Maple
    A135257 := proc(nmax) local a,anext,diffset,good,an ; a := [4,6] ; diffset := {2} ; while nops(a) < nmax do for anext from op(-1,a)+1 do if numtheory[bigomega](anext) = 2 then good := true ; for an in a do if ( anext-an) in diffset then good := false ; break ; fi ; od; if good then for an from 1 to nops(a) do diffset := diffset union { anext-op(an,a) } ; od; a := [op(a),anext] ; break ; fi ; fi ; od ; od: a ; end: A135257(60) ; # R. J. Mathar, Jan 08 2008
  • Python
    from itertools import count, islice
    from sympy import factorint
    def A135257_gen(): # generator of terms
        aset2, alist = set(), []
        for k in count(0):
            if sum(factorint(k).values()) == 2:
                bset2 = set()
                for a in alist:
                    if (b:=k-a) in aset2:
                        break
                    bset2.add(b)
                else:
                    yield k
                    alist.append(k)
                    aset2.update(bset2)
    A135257_list = list(islice(A135257_gen(),30)) # Chai Wah Wu, Sep 11 2023

Extensions

Corrected and extended by R. J. Mathar, Jan 08 2008
Showing 1-4 of 4 results.