login
Numbers k such that the smallest k-digit odd number concatenated with the largest k-digit odd number is prime.
1

%I #25 Apr 25 2023 20:24:39

%S 1,3,9,21,5571,6493,14481

%N Numbers k such that the smallest k-digit odd number concatenated with the largest k-digit odd number is prime.

%C Numbers k such that 10^(k-1)+1 concatenated with 10^k-1 is prime.

%C a(7) > 10^4.

%C From _Robert Israel_, Jan 08 2017: (Start)

%C Numbers k such that 10^(2k-1) + 2*10^k - 1 is prime.

%C All terms are odd. (End)

%C a(8) > 24292. - _J.W.L. (Jan) Eerland_, Apr 08 2023

%e The smallest and largest odd 3-digit numbers are 101 and 999, respectively. Since 101999 is prime, 3 is a term of the sequence.

%e The smallest and largest odd 4-digit numbers are 1001 and 9999, respectively. Since 10019999 is not prime, 4 is not a term of this sequence.

%p select(n -> isprime(10^(2*n-1)+2*10^n-1), [seq(i,i=1..1000,2)]); # _Robert Israel_, Jan 08 2017

%t k=1; Monitor[Parallelize[While[True,If[FromDigits[Join@@IntegerDigits/@{10^(k-1)+1,10^k-1}]//PrimeQ,Print[k]];k++];k],k] (* _J.W.L. (Jan) Eerland_, Apr 08 2023 *)

%o (PARI) f(n)=eval(concat(Str(10^(n-1)+1),10^n-1))

%o for(n=1,10^4,if(ispseudoprime(f(n)),print1(n,", ")))

%Y Cf. A247183.

%K nonn,hard,more,base

%O 1,2

%A _Derek Orr_, Nov 22 2014

%E a(7) from _J.W.L. (Jan) Eerland_, Apr 08 2023