login
Least k such that concatenation k, prime(n), k is a prime.
3

%I #13 Jul 01 2021 12:08:23

%S 7,1,1,3,13,17,1,9,1,1,3,3,3,3,1,1,3,3,3,7,3,3,1,57,17,3,3,1,9,1,33,1,

%T 19,3,1,3,3,9,57,1,3,21,7,9,1,21,9,3,7,21,7,1,3,1,3,3,3,3,9,7,3,3,3,3,

%U 9,1,9,41,7,3,3,1,29,9,11,1,3,9,1,9,7,3,3,17,9,1,31,17,3,17,3,7,27,3,9,1

%N Least k such that concatenation k, prime(n), k is a prime.

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

%t lk[n_]:=Module[{idn=IntegerDigits[n],k=1},While[!PrimeQ[FromDigits[ Join[ IntegerDigits[k],idn, IntegerDigits[k]]]],k=k+2];k]; Table[lk[i],{i, Prime[ Range[100]]}] (* _Harvey P. Dale_, Apr 26 2015 *)

%o (Python)

%o from sympy import prime, isprime

%o def a(n):

%o spn = str(prime(n)); k = 1; sk = str(k)

%o while not isprime(int(sk + spn + sk)): k += 1; sk = str(k)

%o return k

%o print([a(n) for n in range(1, 97)]) # _Michael S. Branicky_, Jul 01 2021

%Y Cf. A090267, A090269.

%K base,nonn

%O 1,1

%A _Amarnath Murthy_, Nov 28 2003

%E More terms from _David Wasserman_, Oct 24 2005