%I #11 Jun 13 2017 22:17:10
%S 3,5,11,17,71,101,191,1031,1301,7349,7457,7547,7589,9437,9857,10007,
%T 10067,10301,10457,10859,11057,11717,11777,11939,12107,12821,13931,
%U 14081,14549,14591,16061,16361,16829,17417,18041,19541,19697,19991
%N Lower bound twin primes such that their digital reverse is prime and a lower bound twin prime.
%H Harvey P. Dale, <a href="/A101783/b101783.txt">Table of n, a(n) for n = 1..2500</a>
%e 17 is a lower bound twin prime and the reverse,71, is prime and also a lower bound twin prime.
%t lbtpQ[n_]:=Module[{rp=FromDigits[Reverse[IntegerDigits[n]]]},PrimeQ[rp] &&PrimeQ[rp+2]]; Select[Transpose[Select[Partition[Prime[Range[2300]], 2,1],Last[#]-First[#]==2&]][[1]],lbtpQ] (* _Harvey P. Dale_, Jan 27 2012 *)
%o (PARI) twlrpr2(n) = { for(x=1,n, y=twinl(x); z=eval(rev(y)); if(isprime(z) && isprime(z+2),print1(y",")) ) } twinl(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)) }
%o rev(str) = \\ Get the reverse of the input string
%o { 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
|