login
Numbers n such that the concatenation n987654321 is prime.
2

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

%S 28,32,44,50,55,58,97,100,107,112,130,149,152,154,179,193,208,233,259,

%T 265,271,287,310,314,320,326,341,359,365,376,404,413,421,439,449,455,

%U 457,466,469,491,499,536,538,545,547,548,557,565,568,574,593,614,616

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

%e 314 is a member of this sequence because 314987654321 is prime.

%o (Python)

%o from sympy import isprime

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

%o # Simplified by _Derek Orr_, Apr 10 2015

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

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

%Y Cf. A232767, A104914, A104915.

%K nonn,base

%O 1,1

%A _Derek Orr_, Nov 29 2013

%E More terms from _Derek Orr_, Apr 10 2015