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.

A068638 a(1) = 1, a(n) = smallest distinct composite number such that a(n) + a(k) is a composite number for all k = 1 to n.

Original entry on oeis.org

1, 8, 14, 20, 24, 25, 26, 32, 38, 44, 50, 56, 62, 68, 74, 80, 86, 90, 92, 94, 98, 104, 110, 116, 118, 120, 122, 128, 134, 140, 144, 146, 152, 158, 160, 164, 170, 176, 182, 184, 188, 194, 200, 206, 212, 218, 220, 224, 230, 234, 236, 242, 248, 254, 260, 264, 266
Offset: 1

Views

Author

Amarnath Murthy, Feb 27 2002

Keywords

Comments

Conjecture: 25 is the largest odd term of this sequence.
Essentially the same as A025044. - R. J. Mathar, Sep 30 2008

Examples

			a(2) = 8 as for the smaller composite numbers 4 and 6 one gets 4 + 1 = 5 and 6 + 1 = 7, both primes. a(3) = 14 as 1 + 14 = 15 and 8 + 14 = 22 are composite.
		

Crossrefs

Cf. A025044.

Programs

  • Mathematica
    a1 = {0}; nmax = 266; Do[ If[Select[n + a1, PrimeQ] == {}, AppendTo[a1, n]] , {n, nmax}]; Rest[a1] (* Ray Chandler, Jan 15 2017 *)
  • Python
    from sympy import isprime
    from itertools import islice
    def agen(start=1): # generator of terms
        alst, k, sums = [0, start], 2, {0} | {start}
        while True:
            yield alst[-1]
            while any(isprime(k+an) for an in alst): k += 1
            alst.append(k)
            k += 1
    print(list(islice(agen(), 60))) # Michael S. Branicky, Dec 15 2022

Extensions

More terms from Sascha Kurz, Mar 17 2002
Description clarified by Ray Chandler, Jan 15 2017