There are 43 3-digit prime numbers which, when reversed, also yield a prime number. (Eight of these are actually consecutive primes).
Of the 43, 15 are simply palindromes (e.g. 929), but of the remaining 14 pairs of numbers (called '
emirp's), one pair in particular exhibits two unique characteristics, one of which is rather surprising.
What are the numbers, and what are their unique characteristics?
list
5 dim P(150)
10 while N<1000
20 N=nxtprm(N)
30 if N>100 and N<1000 then
40 :S=cutspc(str(N))
50 :if left(S,1)<>right(S,1) then
60 :Ct=Ct+1:P(Ct)=cutspc(str(N))
70 wend
80 for I=1 to Ct-1
90 for J=I+1 to Ct
100 if left(P(I),1)=right(P(J),1) and left(P(J),1)=right(P(I),1) then
105 :if mid(P(I),2,1)=mid(P(J),2,1) then
110 :print P(I),P(J)
120 next
130 next
OK
run
107 701
113 311
149 941
157 751
167 761
179 971
199 991
337 733
347 743
359 953
389 983
709 907
739 937
769 967
OK
Now, what's special about one of these pairs?
|
Posted by Charlie
on 2009-01-10 14:23:33 |