login
Concatenation of n-th nonprime and n-th prime.
2

%I #12 Oct 17 2020 18:03:17

%S 12,43,65,87,911,1013,1217,1419,1523,1629,1831,2037,2141,2243,2447,

%T 2553,2659,2761,2867,3071,3273,3379,3483,3589,3697,38101,39103,40107,

%U 42109,44113,45127,46131,48137,49139,50149,51151,52157,54163,55167,56173,57179,58181,60191,62193,63197,64199,65211,66223,68227,69229

%N Concatenation of n-th nonprime and n-th prime.

%C Concatenate A018252(n) and A000040(n).

%H Reinhard Zumkeller, <a href="/A253911/b253911.txt">Table of n, a(n) for n = 1..10000</a>

%e a(5) = 911 because the 5th nonprime is 9 and the 5th prime is 11.

%t cncat[{a_,b_}]:=FromDigits[Flatten[IntegerDigits/@{a,b}]]; Module[ {nn=100,np,len},np = Select[Range[nn],!PrimeQ[#]&];len=Length[np];cncat/@Thread[{np,Prime[Range[len]]}]] (* _Harvey P. Dale_, Oct 17 2020 *)

%o (PARI) nprime(n)=c=0; k=1; while(k, if(!isprime(k), c++); if(c==n, return(k)); k++)

%o vector(50, n, eval(concat(Str(nprime(n)), Str(prime(n))))) \\ Derek Orr, Feb 06 2015

%o (Haskell)

%o import Data.Function (on)

%o a253911 n = a253911_list !! (n-1)

%o a253911_list = map read $

%o zipWith ((++) `on` show) a018252_list a000040_list :: [Integer]

%o -- _Reinhard Zumkeller_, Feb 09 2015

%Y Cf. A000040, A018252, A038530, A045532, A075110, A106582, A138821, A138822, A253910.

%K nonn,base,easy

%O 1,1

%A _Omar E. Pol_, Feb 06 2015