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.

A381061 First of six consecutive primes such that sum of any five terms is prime.

Original entry on oeis.org

9733, 970217, 3218471, 5241937, 5691893, 8445251, 8788079, 11268497, 11881901, 16697419, 19604623, 22057961, 22926473, 26027723, 26939197, 38187463, 38938153, 39901963, 45190247, 52489691, 54887597, 58296113, 61909753, 62686369, 68142289, 69567359, 69799033, 72085687, 72973723, 79517741, 82464511
Offset: 1

Views

Author

Zak Seidov and Robert Israel, Feb 12 2025

Keywords

Examples

			a(2) = 970217 is a term because 970217, 970219, 970231, 970237, 970247, 970259 are six consecutive primes such that the sums of five of the six are
    970217 + 970219 + 970231 + 970237 + 970247 = 4851151
    970217 + 970219 + 970231 + 970237 + 970259 = 4851163
    970217 + 970219 + 970231 + 970247 + 970259 = 4851173
    970217 + 970219 + 970237 + 970247 + 970259 = 4851179
    970217 + 970231 + 970237 + 970247 + 970259 = 4851191
    970219 + 970231 + 970237 + 970247 + 970259 = 4851193
which are all prime.
		

Crossrefs

Programs

  • Maple
    P:= [2,3,5,7,11,13]: S:= convert(P,`+`);
    R:= NULL: count:= 0:
    while count < 40 do
      p:= nextprime(P[6]);
      S:= S + p - P[1];
      P:= [op(P[2..6]),p];
      if andmap(t -> isprime(S-t), P) then
        R:= R,P[1]; count:= count+1;
      fi
    od:
    R;
  • Python
    from sympy import isprime, nextprime
    from itertools import combinations, islice
    def agen(): # generator of terms
        P = [2, 3, 5, 7, 11, 13]
        while True:
            if all(isprime(sum(c)) for c in combinations(P, 5)):
                yield P[0]
            P = P[1:] + [nextprime(P[-1])]
    print(list(islice(agen(), 7))) # Michael S. Branicky, Feb 12 2025

A381062 a(n) is the first prime p such that the sum of any 2*n-1 of the 2*n consecutive primes starting with p is prime.

Original entry on oeis.org

2, 19, 9733, 69398759
Offset: 1

Views

Author

Robert Israel, Feb 12 2025

Keywords

Examples

			a(2) = 19 because the sum of any 3 of the 4 primes 19, 23, 29, 31 is prime:
  19 + 23 + 29 = 71
  19 + 23 + 31 = 73
  19 + 29 + 31 = 79
  23 + 29 + 31 = 83 are all prime, and 19 is the first prime that works.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local P,S,p,i;
      P:= [0,seq(ithprime(i),i=1..2*n-1)]:
      S:= convert(P,`+`);
      do
        p:= nextprime(P[-1]);
        S:= S + p - P[1];
        P:= [op(P[2..-1]),p];
        if andmap(t -> isprime(S-t),P) then return P[1] fi
      od
    end proc:
    map(f, [$1..4]);
Showing 1-2 of 2 results.