login
A101782
Upper bound of twin prime pairs whose digital reverse is prime.
1
5, 7, 13, 31, 73, 151, 181, 199, 313, 1021, 1033, 1153, 1231, 1279, 1321, 1429, 1453, 1669, 1723, 1789, 1879, 1933, 3121, 3169, 3301, 3373, 3391, 3463, 3469, 3541, 3583, 3853, 7459, 7561, 7879, 7951, 9001, 9013, 9241, 9421, 9439, 9679, 9721, 9769, 9931
OFFSET
1,1
LINKS
EXAMPLE
13 is the upper bound of twin prime pair (11,13) and its digital reverse, 31, is prime.
MAPLE
digrev:= proc(n) local L, i;
L:= convert(n, base, 10);
add(L[-i]*10^(i-1), i=1..nops(L))
end proc:
select(t -> isprime(t) and isprime(t-2) and isprime(digrev(t)), [5, seq(i, i=7 .. 10^5, 6)]); # Robert Israel, Dec 08 2024
PROG
(PARI) twurpr(n) = { for(x=1, n, y=twinu(x); z=eval(rev(y)); if(isprime(z), print1(y", ")) ); }
twinu(n) = /* The n-th upper twin prime */ { local(c, x); c=0; x=1; while(c<n, if(isprime(prime(x)+2), c++); x++; ); return(prime(x)); }
rev(str) = /* Get the reverse of the input string */ { local(tmp, s, j); tmp = Vec(Str(str)); s=""; forstep(j=length(tmp), 1, -1, s=concat(s, tmp[j])); return(s); }
CROSSREFS
Sequence in context: A293059 A179625 A141191 * A288889 A168609 A266951
KEYWORD
easy,nonn,base
AUTHOR
Cino Hilliard, Jan 26 2005
STATUS
approved