OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..1200
EXAMPLE
p2 = 29 is a term since the previous prime is p1 = 23, 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, p2]], {n, 13^5}]; Print[a];
chkQ[{a_, b_}]:=Module[{c=a^2+b^3, d=a^3+b^2}, AllTrue[{c+1, c-1, d+1, d-1}, PrimeQ]]; Transpose[Select[Partition[ Prime[Range[ 3000000]], 2, 1], chkQ]][[2]] (* The program uses the AllTrue function from Mathematica version 10. *) (* Harvey P. Dale, Nov 25 2014 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Joseph Stephan Orlovsky, May 16 2008
EXTENSIONS
More terms from Harvey P. Dale, Nov 25 2014
More terms from Amiram Eldar, Jan 02 2020
STATUS
approved