login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Primes p such that the concatenation 123456789p is prime.
2

%I #25 Jun 03 2020 12:13:07

%S 23,29,167,191,199,257,311,409,419,433,457,563,587,601,653,761,769,

%T 809,881,947,1013,1069,1091,1153,1163,1187,1223,1259,1283,1307,1433,

%U 1489,1511,1723,1787,1789,1913,1993,2039,2137

%N Primes p such that the concatenation 123456789p is prime.

%C Primes in A232725.

%H Harvey P. Dale, <a href="/A232726/b232726.txt">Table of n, a(n) for n = 1..1000</a>

%e 1163 is in this sequence because 1163 and 1234567891163 are prime.

%t Select[Prime[Range[500]],PrimeQ[FromDigits[Join[Range[9], IntegerDigits[ #]]]]&] (* _Harvey P. Dale_, Nov 26 2014 *)

%o (Python)

%o from sympy import isprime

%o for n in range(5000):

%o if isprime(n) and isprime(int("123456789" + str(n))):

%o print(n, end=', ') # simplified by _Derek Orr_, Nov 27 2014

%o (PARI) forprime(p=1,5000,if(isprime(eval(concat("123456789",Str(p)))),print1(p,", "))) \\ _Derek Orr_, Nov 27 2014

%Y Cf. A232725, A104914, A104915.

%K nonn,base,less

%O 1,1

%A _Derek Orr_, Nov 29 2013