login
A245763
Primes p such that the concatenation of p with its digit sum and the concatenation of the digit sum of p with p are both prime.
2
61, 337, 353, 449, 577, 881, 937, 971, 991, 1091, 1129, 1217, 1297, 1381, 1543, 1657, 1693, 2069, 2137, 2539, 2621, 2791, 3347, 3727, 3943, 4157, 4201, 4243, 4513, 4861, 5077, 5431, 5701, 5927, 6043, 6317, 6353, 6421, 6449, 6661, 6917, 7109, 7127, 7507, 7547
OFFSET
1,1
COMMENTS
Intersection of A246428 and A245759.
LINKS
EXAMPLE
61 is in the sequence because it is prime; concatenation[61 with (6 + 1)] = 617 is prime and concatenation[(6 + 1) with 61] = 761 is also prime.
337 is in the sequence because it is prime; concatenation[337 with (3 + 3 + 7)] = 33713 is prime and concatenation[(3 + 3 + 7) with 337] = 13337 is also prime.
MAPLE
with(StringTools): A245763 := proc() local a, b, d, e; a:=ithprime(n); b:=add( i, i = convert((a), base, 10))(a); d:=parse(cat(a, b)); e:= parse(cat(b, a)); if isprime(d)and isprime(e) then RETURN (a); fi; end: seq(A245763 (), n=1..2000);
MATHEMATICA
cdsQ[n_]:=Module[{ds=Total[IntegerDigits[n]]}, AllTrue[ {n*10^IntegerLength[ ds]+ ds, ds*10^IntegerLength[ n]+n}, PrimeQ]]; Select[Prime[Range[1100]], cdsQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Sep 23 2016 *)
PROG
(PARI)
for(n=1, 10^4, p=prime(n); d=Str(sumdigits(p)); if(isprime(eval(concat(Str(p), d)))&&isprime(eval(concat(d, Str(p)))), print1(p, ", "))) \\ Derek Orr, Jul 31 2014
(Python)
from sympy import prime, isprime
A245763 = [int(n) for n in (str(prime(x)) for x in range(1, 10**3))
..........if isprime(int(str(sum([int(d) for d in n]))+n)) and
..........isprime(int(n+str(sum([int(d) for d in n]))))]
# Chai Wah Wu, Aug 27 2014
CROSSREFS
KEYWORD
nonn,base
AUTHOR
K. D. Bajpai, Jul 31 2014
STATUS
approved