OFFSET
1,1
COMMENTS
Symbolically, the sequence is of p = prime(i) where q = (prime(i + 2) - prime(i))/2 and p and q are prime.
An examination of the first 10^9 primes (using Mathematica) shows that the largest value of q is 157 and it occurs just once: where p = 1907251013.
prime(k+1) where A052288(k) is prime. - Robert Israel, Dec 04 2017
Number of terms less than 10^k: 0, 3, 17, 72, 454, 3034, 22222, 174228, ... - Muniru A Asiru, Jan 24 2018
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
{3, 7} represents a pair of alternate primes, their difference is 4 which is twice a prime (2). Likewise, {787, 809}, their difference being twice 11.
MAPLE
P:= select(isprime, [seq(i, i=3..10^4, 2)]):
P[select(t -> isprime((P[t+2]-P[t])/2), [$1..nops(P)-2])]; # Robert Israel, Dec 04 2017
MATHEMATICA
For[p = 1, p < 100000001, p++,
a = Prime[p];
b = Prime[p + 2];
q = (b - a)/2;
If[PrimeQ[q] == True, Print[a, " ", b, " ", q]];
] (* Marnell *)
Select[Prime[Range[1000]], PrimeQ[(NextPrime[#, 2] - #)/2] &] (* Alonso del Arte, Nov 25 2017 *)
searchMax = 200; primes = Prime[Range[searchMax + 2]]; halfAlternPrimeDiffs = Table[(primes[[n + 2]] - primes[[n]])/2, {n, searchMax}]; primes[[Select[Range[searchMax], PrimeQ[halfAlternPrimeDiffs[[#]]] &]]] (* Alonso del Arte, Nov 26 2017 *)
Select[{#1, #2, (#2 - #1)/2} & @@ # & /@ Transpose@ {Take[#, Length@ # - 2], Drop[#, 2]} &@ Prime@ Range@ 130, PrimeQ@ Last@ # &][[All, 1]] (* Michael De Vlieger, Dec 04 2017 *)
Select[Partition[Prime[Range[200]], 3, 1], PrimeQ[(#[[3]]-#[[1]])/2]&][[All, 1]] (* Harvey P. Dale, Feb 20 2020 *)
PROG
(PARI) lista(nn) = {precp = 3; precq = 5; forprime(p=7, nn, if (isprime((p-precp)/2), print1(precp, ", ")); precp = precq; precq = p; ); } \\ Michel Marcus, Jan 08 2018
(GAP) P:=Filtered([3..10^4], IsPrime);;
B := List([1..Length(P)-2], i->(P[i+2]-P[i])/2);;
o := [];; for i in [1..Length(B)] do if IsPrime(B[i]) then Add(o, P[i]); fi; od; o := A295705; # Muniru A Asiru, Jan 24 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Geoffrey Marnell, Nov 25 2017
STATUS
approved