A045336 Palindromic terms from A019546.
2, 3, 5, 7, 353, 373, 727, 757, 32323, 33533, 35353, 35753, 37273, 37573, 72227, 72727, 73237, 75557, 77377, 3222223, 3223223, 3233323, 3252523, 3272723, 3337333, 3353533, 3553553, 3722273, 3732373, 3773773, 7257527, 7327237, 7352537, 7527257, 7722277
Offset: 1
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..12725 (all terms with <= 17 digits; terms 1..330 from Harvey P. Dale)
- Chris K. Caldwell and G. L. Honaker, Jr., 7352537, Prime Curios!
Programs
-
Mathematica
Select[ Range[ 1, 10^7 ], PrimeQ[ # ] && FreeQ[ RealDigits[ # ][ [ 1 ] ], 0 ] && FreeQ[ RealDigits[ # ][ [ 1 ] ], 1 ] && FreeQ[ RealDigits[ # ][ [ 1 ] ], 4 ] && FreeQ[ RealDigits[ # ][ [ 1 ] ], 6 ] && FreeQ[ RealDigits[ # ][ [ 1 ] ], 8 ] && FreeQ[ RealDigits[ # ][ [ 1 ] ], 9 ] && RealDigits[ # ][ [ 1 ] ] == Reverse[ RealDigits[ # ][ [ 1 ] ] ] & ] Table[FromDigits/@Select[Tuples[{2,3,5,7},n],#==Reverse[#]&&PrimeQ[ FromDigits[ #]]&],{n,12}]//Flatten (* Harvey P. Dale, Jun 19 2016 *) Select[Flatten[Table[FromDigits/@Tuples[{2,3,5,7},n],{n,10}]],PrimeQ[#]&&PalindromeQ[#]&] (* Harvey P. Dale, Mar 24 2025 *) f@n_ := Prime@n; g@l_ := FromDigits@# & /@ Table[Join[l, {f@i}, Reverse@l], {i, 4}]; Flatten[g@# & /@ (f@# & /@ Select[Table[IntegerDigits[n, 5], {n, 2000}], FreeQ[#, 0] &])] // Select[PrimeQ] (* Hans Rudolf Widmer, Dec 18 2021 *)
-
Python
from sympy import isprime from itertools import count, product, takewhile def primedigpals(): for d in count(1, 2): for p in product("2357", repeat=d//2): left = "".join(p) for mid in "2357": yield int(left + mid + left[::-1]) def aupto(N): return list(takewhile(lambda x: x<=N, filter(isprime, primedigpals()))) print(aupto(10**7)) # Michael S. Branicky, Dec 18 2021
Comments