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.

A359065 Lexicographically earliest sequence of distinct positive composite integers such that no subsequence sums to a prime and in which all terms are coprime.

Original entry on oeis.org

4, 21, 65, 209, 391, 3149, 9991, 368131, 57556589, 14865154981
Offset: 1

Views

Author

Conor Houghton, Dec 15 2022

Keywords

Comments

The sequences A052349 and A068638 are composed of integers starting from one with the rule that no subsequence has a prime sum; these sequences start with one. Starting with a different number seems to result in straightforward geometric sequences, for example the sequence with no prime subsequence sums starting with four is 4, 6, 8, and so on. One way to avoid this is to enforce a coprime rule, requiring that the entries to the sequence are coprime. It is not clear whether the sequence is infinite.

Crossrefs

Programs

  • Mathematica
    k = 4; K = {k}; f = {2}; q = Subsets[K]; While[Length@K < 10, k++; If[! PrimeQ[k] && ! IntersectingQ[FactorInteger[k][[All, 1]], f], s = k; z = 0; For[p = 1, p <= Length@q, p++, If[PrimeQ[Total[q[[p]]] + k], z = 1; Break[]]]; If[z == 0, AppendTo[K, k]; q = Subsets[K]; AppendTo[f, FactorInteger[k][[All, 1]]]; f = Flatten[f]]]]; Print[K] (* Samuel Harkness, Apr 11 2023 *)
  • Python
    import sys
    import math
    from sympy.ntheory import primefactors
    from sympy.ntheory import primerange
    def intersection(lst1, lst2):
        lst3 = [value for value in lst1 if value in lst2]
        return len(lst3)
    n_primes=1000000
    factors=[primefactors(n) for n in range(0,n_primes)]
    primes=list(primerange(0, n_primes))
    sequence=[4]
    sums=[sequence[0]]
    prime_factors=[f for f in factors[sequence[0]]]
    big_n=8
    while len(sequence)
    				
  • Python
    from math import gcd
    from sympy import isprime
    from itertools import islice
    def agen(start=4): # generator of terms
        alst, k, sums = [start], start+1, {0} | {start}
        while True:
            yield alst[-1]
            while any(gcd(k, an) != 1 for an in alst) or \
                  any(k+s not in sums and isprime(k+s) for s in sums):
                k += 1
            alst.append(k)
            sums.update([k + s for s in sums])
            k += 1
    print(list(islice(agen(), 8))) # Michael S. Branicky, Dec 16 2022

Extensions

a(8)-a(9) from Michael S. Branicky, Dec 15 2022
a(10) from Rémy Sigrist, Dec 16 2022