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.

A061781 Number of distinct sums p(i) + p(j) for 1<=i<=j<=n, p(k) = k-th prime.

Original entry on oeis.org

1, 3, 6, 9, 13, 17, 21, 25, 29, 33, 39, 44, 50, 54, 59, 63, 67, 75, 80, 86, 91, 95, 101, 107, 114, 120, 126, 131, 136, 140, 148, 154, 160, 168, 174, 180, 187, 192, 199, 205, 211, 219, 224, 231, 237, 242, 249, 255, 264, 270, 278, 283, 289, 296, 302, 306, 310, 319
Offset: 1

Views

Author

Labos Elemer, Jun 22 2001

Keywords

Examples

			Let P(n) = {2, 3, .., p_n} be the set of the first n primes. Construct S(n) = {p+q : p,q in P}. If every sum p+q were distinct, then |S(n)| would be n*(n+1)/2 = A000217(n). But in reality, for n >= 4, certain sums occur more than once. a(n) = |S(n)|. For example, P(6) = {2, 3, 5, 7, 11, 13} yields S(6) = {4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 18, 20, 22, 24, 26}. Thus, a(6) = 17.
		

Crossrefs

Programs

  • Mathematica
    f[x_] := Prime[x]
    Table[Length[Union[Flatten[Table[f[u]+f[w], {w, 1, m}, {u, 1, m}]]]], {m, 1, 75}]

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