OFFSET
1,1
COMMENTS
Prime numbers that remain primes when their central digit is (or two central digits are) deleted.
At the 1886th prime number (16229), there are exactly 943 centrally deletable primes, and 943 that become composites. It appears that there are always more non-deletable primes thereafter.
LINKS
Christian N. K. Anderson, Table of n, a(n) for n = 1..10000
EXAMPLE
a(5) = 1(1)3, and 13 is a prime.
MATHEMATICA
dcd[n_] := Block[{d = IntegerDigits@n, z}, z = Length@d; FromDigits@ Delete[d, Floor[(z + {{1}, {2}})/2]]]; Select[Prime@ Range@ 103, PrimeQ@ dcd@ # &] (* Giovanni Resta, Apr 29 2013 *)
PROG
(R) library(gmp)
sumsubstrpow<-function(n) {
no0<-function(s){ while(substr(s, 1, 1)=="0" && nchar(s)>1) s=substr(s, 2, nchar(s)); s}
tot=as.bigz(0); s=as.character(n); len=nchar(s)
for(i in 1:len) for(j in i:len) tot=tot+as.bigz(no0(substr(s, i, j)))^(j-i+1)
tot
}
#recursive
n=as.bigz(10); for(y in 1:4) n[y+1]=sumsubstrpow(n[y])
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Kevin L. Schwartz and Christian N. K. Anderson, Apr 26 2013
STATUS
approved