OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 1249 is a term because 2*1249 = 2498 and 12492498 is the average of the twin prime pair 12492497, 12492499.
MAPLE
filter:= proc(p) local r;
if not isprime(p) then return false fi;
r:= p*10^(1+ilog10(2*p))+2*p;
isprime(r+1) and isprime(r-1)
end proc:
select(filter, [seq(seq(10*i+j, j=[1, 9]), i=1..10000)]);
MATHEMATICA
Select[Prime[Range[2200]], And @@ PrimeQ[FromDigits[Join[IntegerDigits[#], IntegerDigits[2*#]]] + {-1, 1}] &] (* Amiram Eldar, Aug 07 2022 *)
PROG
(Python)
from sympy import isprime
def ok(n):
if not isprime(n): return False
t = int(str(n)+str(2*n))
return isprime(t-1) and isprime(t+1)
print([k for k in range(20000) if ok(k)]) # Michael S. Branicky, Aug 07 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
J. M. Bergot and Robert Israel, Aug 07 2022
STATUS
approved