%I #6 Oct 01 2013 17:58:06
%S 5,7,13,31,73,151,181,199,313,1021,1033,1153,1231,1279,1321,1429,1453,
%T 1669,1723,1789,1879,1933,3121,3169,3301,3373,3391,3463,3469,3541,
%U 3583,3853,7459,7561,7879,7951,9001,9013,9241,9421,9439,9679,9721,9769,9931
%N Upper bound of twin prime pairs whose digital reverse is prime.
%e 13 is the upper bound of twin prime pair (11,13) and its digital reverse, 31, is prime.
%o (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) }
%K easy,nonn,base
%O 1,1
%A _Cino Hilliard_, Jan 26 2005
|