login
Numbers n such that the concatenation 123456789n is prime.
1

%I #22 Sep 08 2022 08:46:06

%S 1,23,29,49,133,143,167,191,199,217,257,311,403,409,419,433,437,451,

%T 457,473,563,587,601,623,629,653,671,689,721,761,769,779,803,809,851,

%U 871,881,893,913,943,947,959,1003,1013,1027,1069,1079,1091,1153,1163,1177

%N Numbers n such that the concatenation 123456789n is prime.

%e 721 is a member of this sequence because 123456789721 is prime.

%o (Python)

%o from sympy import isprime

%o {print(n,end=', ') for n in range(2000) if isprime(int("123456789"+str(n)))}

%o # Simplified by _Derek Orr_, Apr 10 2015

%o (PARI) for(n=1,2000,if(isprime(eval(concat("123456789",Str(n)))),print1(n,", "))) \\ _Derek Orr_, Apr 10 2015

%o (Magma) [n: n in [0..1500] | IsPrime(Seqint(Intseq(n) cat Intseq(123456789)))]; // _Vincenzo Librandi_, Apr 11 2015

%Y Cf. A232726, A104914, A104915.

%K nonn,base

%O 1,2

%A _Derek Orr_, Nov 29 2013

%E More terms from _Derek Orr_, Apr 10 2015