login
A199306
Palindromic primes in the sense of A007500 with digits '0', '1' and '6' only.
3
11, 101, 1061, 1601, 10061, 10601, 11161, 16001, 16061, 16111, 16661, 101611, 106661, 116101, 166601, 1011601, 1016011, 1016611, 1061101, 1066111, 1106101, 1110611, 1111661, 1116601, 1160111, 1160611, 1166101, 1600061, 1611161, 1616161, 1660661, 1661111, 10011101, 10100161, 10106111
OFFSET
1,1
COMMENTS
All terms start and end with the digit '1'. This fact is used in the given PARI program.
PROG
(PARI) a(n=50, list=0, L=[0, 1, 6])={ for(d=1, 1e9, my(t, u=vector(d-1, i, 10^(d-i))~, o=10^d+1); forvec(v=vector(#u, i, [1, #L]), isprime(t=o+vector(#u, i, L[v[i]])*u) || next; isprime(A004086(t)) || next; list & print1(t", "); n-- || return(t)))} \\ M. F. Hasler, Nov 07 2011
(Magma) [p: p in PrimesUpTo(10^8) | Set(Intseq(p)) subset [0, 1, 6] and IsPrime(Seqint(Reverse(Intseq(p))))]; // Bruno Berselli, Nov 07 2011
CROSSREFS
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Nov 06 2011
STATUS
approved