Find the smallest prime that remains prime
when added to its reversal
P&P solution preferred
The first 100 cases are shown below. Each line shows the number, its reverse and the sum. While the lowest starting prime is 229, the lowest prime sum is 383, arising from 241.
229 922 1151
239 932 1171
241 142 383
257 752 1009
269 962 1231
271 172 443
277 772 1049
281 182 463
439 934 1373
443 344 787
463 364 827
467 764 1231
479 974 1453
499 994 1493
613 316 929
641 146 787
653 356 1009
661 166 827
673 376 1049
677 776 1453
683 386 1069
691 196 887
811 118 929
823 328 1151
839 938 1777
863 368 1231
881 188 1069
20011 11002 31013
20029 92002 112031
20047 74002 94049
20051 15002 35053
20101 10102 30203
20161 16102 36263
20201 10202 30403
20249 94202 114451
20269 96202 116471
20347 74302 94649
20389 98302 118691
20399 99302 119701
20441 14402 34843
20477 77402 97879
20479 97402 117881
20507 70502 91009
20521 12502 33023
20611 11602 32213
20627 72602 93229
20717 71702 92419
20759 95702 116461
20809 90802 111611
20879 97802 118681
20887 78802 99689
20897 79802 100699
20981 18902 39883
21001 10012 31013
21019 91012 112031
21089 98012 119101
21157 75112 96269
21169 96112 117281
21211 11212 32423
21377 77312 98689
21379 97312 118691
21419 91412 112831
21467 76412 97879
21491 19412 40903
21521 12512 34033
21529 92512 114041
21559 95512 117071
21569 96512 118081
21577 77512 99089
21601 10612 32213
21611 11612 33223
21617 71612 93229
21647 74612 96259
21661 16612 38273
21701 10712 32413
21727 72712 94439
21751 15712 37463
21767 76712 98479
21817 71812 93629
21841 14812 36653
21851 15812 37663
21859 95812 117671
21881 18812 40693
21961 16912 38873
21991 19912 41903
22027 72022 94049
22031 13022 35053
22039 93022 115061
22079 97022 119101
22091 19022 41113
22147 74122 96269
22159 95122 117281
22171 17122 39293
22229 92222 114451
22247 74222 96469
22291 19222 41513
22367 76322 98689
22369 96322 118691
22397 79322 101719
22409 90422 112831
Do
p = nxtprm(p)
If p > 10 Then
s$ = LTrim(Str(p))
r$ = ""
For i = 1 To Len(s)
r = Mid(s, i, 1) + r
Next
If prmdiv(Val(r) + p) = Val(r) + p Then
Text1.Text = Text1.Text & p & " " & r & " " & Val(r) + p & crlf
ct = ct + 1
End If
End If
DoEvents
Loop Until ct = 100
|
Posted by Charlie
on 2018-09-24 12:58:00 |