OFFSET
1,1
EXAMPLE
13 is the upper bound of twin prime pair (11,13) and its digital reverse, 31, is prime.
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
KEYWORD
easy,nonn,base
AUTHOR
Cino Hilliard, Jan 26 2005
STATUS
approved