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.

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

This page as a plain text file.
%I A199302 #19 Sep 08 2022 08:46:00
%S A199302 2,11,101,1021,1201,110221,111211,112111,120121,121021,122011,1000211,
%T A199302 1010201,1020101,1022011,1022201,1101211,1102111,1102201,1111021,
%U A199302 1112011,1120001,1120121,1120211,1121011,1201021,1201111,1210211,1212121,1221221,10002121
%N A199302 Palindromic primes in the sense of A007500 with digits '0', '1' and '2' only.
%C A199302 All terms except for the initial 2 start and end in the digit 1.
%o A199302 (PARI) allow=Vec("012");forprime(p=1,default(primelimit),setminus( Set( Vec(Str( p ))),allow)&next;isprime(A004086(p))&print1(p",")) /* better use the much more efficient code below */
%o A199302 (PARI) a(n=50,list=0,L=[0,1,2],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 A199302 (Magma) [p: p in PrimesUpTo(10^8) | Set(Intseq(p)) subset [0..2] and IsPrime(Seqint(Reverse(Intseq(p))))];  // _Bruno Berselli_, Nov 07 2011
%o A199302 (Python)
%o A199302 from itertools import count, islice, product
%o A199302 from sympy import isprime
%o A199302 def A199302_gen(): return (n for n in (int(t+''.join(s)) for l in count(0) for t in '12' for s in product('012',repeat=l)) if isprime(n) and isprime(int(str(n)[::-1])))
%o A199302 A199302_list = list(islice(A199302_gen(),20)) # _Chai Wah Wu_, Jan 04 2022
%Y A199302 Cf. A020449 - A020472, A199325 - A199329, A199303 - A199306.
%K A199302 nonn,base
%O A199302 1,1
%A A199302 _M. F. Hasler_, Nov 04 2011