The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A199303 Palindromic primes in the sense of A007500 with digits '0', '1' and '3' only. 2
3, 11, 13, 31, 101, 113, 131, 311, 313, 1031, 1033, 1103, 1301, 3011, 3301, 10301, 10333, 11003, 11311, 13331, 30011, 30103, 31013, 31033, 33013, 33301, 101333, 110311, 113011, 113131, 131311, 133033, 133103, 301331, 301333, 330331, 333101, 333103, 1000033, 1001003, 1001303, 1003001 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
MATHEMATICA
Flatten[{#, IntegerReverse[#]}&/@Select[FromDigits/@Tuples[{0, 1, 3}, 7], AllTrue[ {#, IntegerReverse[ #]}, PrimeQ]&]]//Union (* Harvey P. Dale, Sep 12 2023 *)
PROG
(PARI) allow=Vec("013"); forprime(p=1, default(primelimit), setminus( Set( Vec( Str( p ))), allow)&next; isprime(A004086(p))&print1(p", ")) /* for illustrative purpose only: better use the code below */
(PARI) a(n=50, list=0, L=[0, 1, 3], needpal=1)={ for(d=1, 1e9, u=vector(d, i, 10^(d-i))~; forvec(v=vector(d, i, [1+(i==1&!L[1]), #L]), isprime(t=vector(d, i, L[v[i]])*u) || next; needpal & !isprime(A004086(t)) & next; list & print1(t", "); n-- || return(t)))} \\ M. F. Hasler, Nov 06 2011
(Magma) [p: p in PrimesUpTo(10^8) | Set(Intseq(p)) subset [0, 1, 3] and IsPrime(Seqint(Reverse(Intseq(p))))]; // Bruno Berselli, Nov 07 2011
(Python)
from itertools import product
from sympy import isprime
A199303_list = [n for n in (int(''.join(s)) for s in product('013', repeat=12)) if isprime(n) and isprime(int(str(n)[::-1]))] # Chai Wah Wu, Dec 17 2015
CROSSREFS
Sequence in context: A111488 A125308 A260044 * A244047 A020451 A018450
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Nov 04 2011
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 17 18:36 EDT 2024. Contains 373463 sequences. (Running on oeis4.)