OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
5 is a term since (5-1)*(5-2) = 4*3 = 12 and (5+1)*(5+2) = 6*7 = 42 are averages of the twin prime pairs (11, 13) and (41, 43).
7 is a term since (7-1)*(7-2) = 6*5 = 30 and (7+1)*(7+2) = 8*9 = 72 are averages of the twin prime pairs (29, 31) and (71, 73).
MATHEMATICA
f[n_]:=PrimeQ[(n-1)*(n-2)-1]&&PrimeQ[(n-1)*(n-2)+1]&&PrimeQ[(n+1)*(n+2)-1]&&PrimeQ[(n+1)*(n+2)+1]; lst={}; Do[p=Prime[n]; If[f[p], AppendTo[lst, p]], {n, 9!}]; lst
Select[Prime[Range[475000]], AllTrue[{(#-1)(#-2)-1, (#-1)(#-2)+1, (#+1) (#+2)- 1, (#+1)(#+2)+1}, PrimeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Apr 14 2020 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Joseph Stephan Orlovsky, Mar 04 2010
EXTENSIONS
More terms from Amiram Eldar, Dec 22 2019
STATUS
approved