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.

A356477 a(n) is the start of the first sequence of 2*n+1 consecutive primes p_1, p_2, ..., p_(2*n+1) such that p_1*p_2 + p_2*p_3 + ... + p_(2*n)*p_(2*n+1) + p_(2*n+1)*p_1 is prime.

Original entry on oeis.org

2, 19, 19, 2, 23, 2, 7, 7, 2, 5, 113, 5, 29, 13, 67, 53, 11, 11, 5, 23, 7, 43, 5, 2, 31, 73, 13, 3, 89, 5, 11, 3, 89, 31, 43, 2, 37, 2, 23, 7, 11, 19, 43, 23, 5, 2, 23, 3, 29, 5, 17, 3, 31, 29, 53, 29, 7, 13, 73, 3, 5, 43, 29, 17, 5, 37, 19, 11, 71, 7, 2, 43, 13, 19, 2, 59, 7, 29, 113, 13, 5, 11
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Aug 08 2022

Keywords

Examples

			a(2) = 19 because 19 is the start of the 2*2+1 = 5 consecutive primes 19, 23, 29, 31, 37 with 19*23 + 23*29 + 29*31 + 31*37 + 37*19 = 3853 prime, and no earlier 5-tuple of consecutive primes works.
		

Crossrefs

Programs

  • Maple
    f:= proc(m) local P,x,i,n;
      n:= 2*m+1;
      P:= Vector(n,ithprime);
    do
       x:= add(P[i]*P[i+1],i=1..n-1)+P[n]*P[1];
       if isprime(x) then return P[1] fi;
       P[1..n-1]:= P[2..n];
       P[n]:= nextprime(P[n]);
    od
    end proc:
    map(f, [$1..100]);
  • Python
    from sympy import isprime, nextprime, prime, primerange
    def a(n):
        p = list(primerange(1, prime(2*n+1)+1))
        while True:
            if isprime(sum(p[i]*p[i+1] for i in range(len(p)-1))+p[-1]*p[0]):
                return p[0]
            p = p[1:] + [nextprime(p[-1])]
    print([a(n) for n in range(1, 83)]) # Michael S. Branicky, Aug 08 2022