OFFSET
1,1
COMMENTS
All terms have an odd number of digits, because if x has an even number of digits, the average of x and its digit reversal is divisible by 11.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 1012481 is a term because 1012481 is an emirp (i.e., it and its digit reversal 1842101 are distinct primes) and the average of 1012481 and 1842101 is 1427291, which is an emirp.
MAPLE
rev:= proc(n) local L, i;
L:= convert(n, base, 10);
add(10^(i-1)*L[-i], i=1..nops(L))
end proc:
isemirp:= proc(n) local r;
if not isprime(n) then return false fi;
r:= rev(n);
r <> n and isprime(r)
end proc:
filter:= proc(n) local t, r, L, i;
if not isprime(n) then return false fi;
r:= rev(n);
r <> n and isprime(r) and isemirp((n+r)/2)
end proc:
count:= 0: R:= NULL:
for m from 2 by 2 while count < 100 do
for d1 in [1, 3, 7, 9] while count < 100 do
for nn from d1*10^m+1 to (d1+1)*10^m by 2 while count < 100 do
if filter(nn) then count:= count+1; R:= R, nn fi
od od od:
R;
MATHEMATICA
emirpQ[n_] := (r = IntegerReverse[n]) != n && And @@ PrimeQ[{n, r}]; Select[Range[1350000], OddQ[IntegerLength[#]] && EvenQ[s = # + IntegerReverse[#]] && emirpQ[#] && emirpQ[s/2] &] (* Amiram Eldar, Sep 11 2022 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Sep 11 2022
STATUS
approved