OFFSET
1,1
COMMENTS
From an idea of Eric Angelini (see seqfan link).
Digit 0 is not considered because the new primes must be different from the starting numbers. Therefore, 101 is not part of the sequence, because the only prime that results from adding one of its digits is 101 + 0 = 101, which is the same number, while 601 is acceptable because 601 + 6 = 607, 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)
EXAMPLE
The number 29 is prime, and 29 + 2 = 31 is also prime.
The same with 487, which produces 487 + 4 = 491, a prime.
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);
PROG
(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
(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
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Paolo P. Lava, Sep 26 2014
STATUS
approved