A225082 Centrally deletable primes.
101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 223, 229, 233, 239, 263, 269, 283, 293, 307, 311, 317, 331, 337, 347, 367, 397, 401, 421, 431, 433, 443, 457, 461, 463, 467, 487, 491, 503, 509, 523, 563
Offset: 1
Examples
a(5) = 1(1)3, and 13 is a prime.
Links
- Christian N. K. Anderson, Table of n, a(n) for n = 1..10000
Programs
-
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 *)
-
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])
Comments