login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A152034
a(n) = largest n-digit prime p whose reversal is a prime q > p.
2
79, 769, 9679, 98999, 995699, 9975899, 99967999, 999548999, 9999049999, 99994169999, 999989299999, 9999954799999, 99999904999999, 999999778999999, 9999999349999999, 99999994999999999, 999999971189999999, 9999999950999999999, 99999999632999999999
OFFSET
2,1
LINKS
MAPLE
revdigs:= proc(x) local L, i; L:= convert(x, base, 10); add(L[-i]*10^(i-1), i=1..nops(L)) end proc:
f:= proc(n)
local d, a, B, r;
for d from floor(n/2) by -1 do
B:= (10^d-1)*(1+10^(n-d));
for a from 10^(n-2*d)-1 to 1 by -1 do
r:= revdigs(a);
if r > a and isprime(B+10^d*a) and isprime(B+10^d*r) then return B+10^d*a fi
od
od
end proc:
map(f, [$2..20]); # Robert Israel, Aug 16 2016
MATHEMATICA
Do[ p = NextPrime[10^(n ), -1 ]; Do[ p1 = FromDigits[ Reverse[IntegerDigits[p]]]; If[PrimeQ[p1] && p1 > p, Print[{n, p}]; Break[]]; p = NextPrime[p, -1], {10^9}], {n, 2, 15}];
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Zak Seidov, Nov 20 2008
EXTENSIONS
More terms from Max Alekseyev, May 03 2011
STATUS
approved