OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..120
EXAMPLE
p1 = 23 is a term since the next prime is p2 = 29, and both p1^2 + p2^3 = 24918 and p1^3 + p2^2 = 13008 are averages of twin primes.
MATHEMATICA
a={}; Do[p1=Prime[n]; p2=Prime[n+1]; p3=p1^2+p2^3; p4=p1^3+p2^2; If[PrimeQ[p3-1]&&PrimeQ[p3+1]&&PrimeQ[p4-1]&&PrimeQ[p4+1], AppendTo[a, p1]], {n, 13^5}]; Print[a];
cpQ[{a_, b_}]:=Module[{p3=a^2+b^3, p4=a^3+b^2}, AllTrue[{p3+1, p3-1, p4+1, p4-1}, PrimeQ]]; Transpose[Select[Partition[Prime[ Range[ 2*10^6]], 2, 1], cpQ]][[1]] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, May 11 2015 *)
PROG
(Magma) [p:p in PrimesInInterval(1, 11000000)| IsPrime(a+1) and IsPrime(a-1) and IsPrime(b+1) and IsPrime(b-1) where a is p^2+q^3 where b is p^3+q^2 where q is NextPrime(p)]; // Marius A. Burtea, Jan 01 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Joseph Stephan Orlovsky, May 15 2008
EXTENSIONS
More terms from Harvey P. Dale, May 11 201
More terms from Amiram Eldar, Jan 01 2020
STATUS
approved