A247896 Primes that produce a different prime when one of its digits is added to it.
29, 43, 61, 67, 89, 167, 227, 239, 263, 269, 281, 349, 367, 389, 439, 457, 461, 463, 487, 499, 521, 563, 601, 607, 613, 641, 643, 647, 653, 677, 683, 821, 827, 983, 1063, 1229, 1277, 1283, 1289, 1361, 1367, 1423, 1427, 1429, 1447, 1481, 1483, 1489, 1549, 1601
Offset: 1
Examples
The number 29 is prime, and 29 + 2 = 31 is also prime. The same with 487, which produces 487 + 4 = 491, a prime.
Links
- Paolo P. Lava, Table of n, a(n) for n = 1..1000
- Eric Angelini, Primes adding one of their digit to themselves (+chains)
Programs
-
Haskell
a247896 n = a247896_list !! (n-1) a247896_list = filter f a000040_list where f p = any ((== 1) . a010051') $ map (+ p) $ filter (> 0) $ map (read . return) $ show p -- Reinhard Zumkeller, Sep 27 2014
-
Maple
P:=proc(q) local a,b,k,n,ok; for n from 1 to q do a:=ithprime(n); ok:=0; for k from 1 to ilog10(a)+1 do b:=trunc((a mod 10^k)/10^(k-1)); if b>0 then if isprime(a+b) then ok:=1; break; fi; fi; od; if ok=1 then print(a); fi; od; end: P(10^6);
-
PARI
/* Description: Generates a vector containing this kind of terms between m^u1 and m^u2 for this definition applied by adding base B digits to the original number in decimal. Here (u1,m,B)=(1,3,10) by default. */ LstThem(u2,u1=1,m=3,B=10)={ my(L:list=List(),y); forprime(x=m^u1,m^u2, y=vecsort(digits(x,B),,8); if(sum(j=1,#y,y[j]&&isprime(x+y[j])), listput(L,x))); vector(#L,i,L[i])} \\ R. J. Cano, Sep 27 2014
Comments