OFFSET
1,1
LINKS
David A. Corneth, Table of n, a(n) for n = 1..4366
PROG
(PARI) lista() = {my(l = List(), pal = vector(199, i, a2113(i)), pri = vector(primepi(10000)), t=0); forprime(i=2, 10000, t++; pri[t]=i); for(i = 2, #pal, for(j=1, #pri, p = conc(pal[i], pri[j]); if(#digits(p) < 6, if(isprime(p), listput(l, p))); p = conc(pri[j], pal[i]); if(#digits(p) < 6, if(isprime(p), listput(l, p))))); listsort(l, 1); l}a2113(n)={my(d, i, r); r=vector(#digits(n-10^(#digits(n\11)))+#digits(n\11)); n=n-10^(#digits(n\11)); d=digits(n); for(i=1, #d, r[i]=d[i]; r[#r+1-i]=d[i]); sum(i=1, #r, 10^(#r-i)*r[i])}
a2113(n)={my(d, i, r); r=vector(#digits(n-10^(#digits(n\11)))+#digits(n\11)); n=n-10^(#digits(n\11)); d=digits(n); for(i=1, #d, r[i]=d[i]; r[#r+1-i]=d[i]); sum(i=1, #r, 10^(#r-i)*r[i])}
conc(a, b) = {a * 10^(#digits(b)) + b} \\ David A. Corneth, Jun 18 2016
(PARI) ispal(n) = n && (eval(subst(Polrev(digits(n)), x, 10)) == n);
isconc(n) = {d = digits(n); for (k=1, #d, na = n\10^k; nb = n % 10^k; if ((n == eval(concat(Str(na), Str(nb)))) && ((isprime(na) && ispal(nb)) || (isprime(nb) && ispal(na))), return(1)); ); }
isok(n) = isprime(n) && isconc(n); \\ Michel Marcus, Jun 20 2016
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Giovanni Teofilatto, Jun 18 2016
STATUS
approved