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.

A199303 Palindromic primes in the sense of A007500 with digits '0', '1' and '3' only.

This page as a plain text file.
%I A199303 #25 Sep 12 2023 14:50:25
%S A199303 3,11,13,31,101,113,131,311,313,1031,1033,1103,1301,3011,3301,10301,
%T A199303 10333,11003,11311,13331,30011,30103,31013,31033,33013,33301,101333,
%U A199303 110311,113011,113131,131311,133033,133103,301331,301333,330331,333101,333103,1000033,1001003,1001303,1003001
%N A199303 Palindromic primes in the sense of A007500 with digits '0', '1' and '3' only.
%H A199303 Chai Wah Wu, <a href="/A199303/b199303.txt">Table of n, a(n) for n = 1..6114</a>
%t A199303 Flatten[{#,IntegerReverse[#]}&/@Select[FromDigits/@Tuples[{0,1,3},7],AllTrue[ {#,IntegerReverse[ #]},PrimeQ]&]]//Union (* _Harvey P. Dale_, Sep 12 2023 *)
%o A199303 (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 */
%o A199303 (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
%o A199303 (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
%o A199303 (Python)
%o A199303 from itertools import product
%o A199303 from sympy import isprime
%o A199303 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
%Y A199303 Cf. A020449 - A020472, A199325 - A199329, A199302 - A199306.
%K A199303 nonn,base
%O A199303 1,1
%A A199303 _M. F. Hasler_, Nov 04 2011