OFFSET
1,1
COMMENTS
q = 2*3*5*7*11*13*17*19 = 9699690.
LINKS
David A. Corneth, Table of n, a(n) for n = 1..164 (Terms <= 10^11)
EXAMPLE
6341442, q+6341442, 2*q+6341442, 3*q+6341442, 4*q+6341442, and 5*q+6341442 are all averages of twin primes, so 6341442 is a term.
MATHEMATICA
q=9699690; lst={};
Do[If[PrimeQ[n-1]&&PrimeQ[n+1] && PrimeQ[n+q*1-1] && PrimeQ[n+q*1+1] && PrimeQ[n+q*2-1] && PrimeQ[n+q*2+1] && PrimeQ[n+q*3-1] && PrimeQ[n+q*3+1] && PrimeQ[n+q*4-1] && PrimeQ[n+q*4+1] && PrimeQ[n+q*5-1] && PrimeQ[n+q*5+1], Print[n]; AppendTo[lst, n]], {n, 10^6, 10^9}];
lst
mkQ[k_]:=Module[{q=Times@@Prime[Range[8]]}, AllTrue[Flatten[Table[x q+k+{1, -1}, {x, 0, 5}], 1], PrimeQ]]; Select[Range[154*10^5], mkQ] (* The program generates the first 4 terms of the sequence. To generate more, increase the Range constant but the program may take a long time to run. *) (* Harvey P. Dale, Apr 09 2023 *)
PROG
(PARI) is(n) = { for(i = 0, 5, if(!isprime(n + i*9699690 - 1), return(0) ); if(!isprime(n + i*9699690 + 1), return(0) ); ); 1 } \\ David A. Corneth, Feb 24 2021
CROSSREFS
KEYWORD
nonn,less
AUTHOR
Vladimir Joseph Stephan Orlovsky, Aug 20 2008
EXTENSIONS
Edited by Jon E. Schoenfield, Feb 24 2021
STATUS
approved