cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A045336 Palindromic terms from A019546.

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, Aug 18 2000

Keywords

Comments

a(33) = 7352537 is the smallest palindromic prime using all prime digits (see Prime Curios! link). - Bernard Schott, Nov 10 2020

Crossrefs

Cf. A019546 and A002385.

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