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.

This page as a plain text file.
%I A356477 #16 Sep 04 2022 12:51:22
%S A356477 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,
%T A356477 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,
%U A356477 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
%N 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.
%H A356477 Robert Israel, <a href="/A356477/b356477.txt">Table of n, a(n) for n = 1..10000</a>
%e A356477 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.
%p A356477 f:= proc(m) local P,x,i,n;
%p A356477   n:= 2*m+1;
%p A356477   P:= Vector(n,ithprime);
%p A356477 do
%p A356477    x:= add(P[i]*P[i+1],i=1..n-1)+P[n]*P[1];
%p A356477    if isprime(x) then return P[1] fi;
%p A356477    P[1..n-1]:= P[2..n];
%p A356477    P[n]:= nextprime(P[n]);
%p A356477 od
%p A356477 end proc:
%p A356477 map(f, [$1..100]);
%o A356477 (Python)
%o A356477 from sympy import isprime, nextprime, prime, primerange
%o A356477 def a(n):
%o A356477     p = list(primerange(1, prime(2*n+1)+1))
%o A356477     while True:
%o A356477         if isprime(sum(p[i]*p[i+1] for i in range(len(p)-1))+p[-1]*p[0]):
%o A356477             return p[0]
%o A356477         p = p[1:] + [nextprime(p[-1])]
%o A356477 print([a(n) for n in range(1, 83)]) # _Michael S. Branicky_, Aug 08 2022
%Y A356477 Cf. A070934, A356471, A356475.
%K A356477 nonn
%O A356477 1,1
%A A356477 _J. M. Bergot_ and _Robert Israel_, Aug 08 2022