# What is the smallest prime $P>2$ with this property?

Let P be a prime number and P=$m^{\text{th}}$ prime number. Here I'm interested in a prime P$>2$, such that P divides the concatenation of the first $(2m-1)$ prime numbers. Using my old laptop I've checked P up to $7919$ (i.e: up to the $1000^{\text{th}}$ prime number)without finding a solution. Can you find the smallest /some primes P$>2$ with such property ?

## migrated from mathematica.stackexchange.comAug 22 '17 at 1:08

This question came from our site for users of Wolfram Mathematica.

• You are using Mathematica for this? Have you written code already? – J. M. is a poor mathematician Aug 19 '17 at 13:18
• No, I did it manually with my laptop. – Sarah B Aug 19 '17 at 13:19
• You did it manually? Such effort... – George N. Missailidis Aug 22 '17 at 1:39

Update: Fixed typo (Sahra B.) and used Divisible (J.M.):

Is this the operation you mean?

concatenate[a__] := ToExpression[StringJoin[ToString /@ a]]

f[m_] := concatenate[Prime[#] & /@ Range[1, 2 m - 1]]

f[#] & /@ Range


{2, 235, 235711, 2357111317, 23571113171923}

checkM[m_] := Divisible[f[m], Prime[m]]

Timing[Select[Range[2,2*10^6], checkM[#] &, 1]]


yields:

{0.207871, {303}}

suggesting that the 303th prime satisfies the above check?

You can look at code and actual integers involved [ here ].

• Might be better to use Divisible[f[m], m]. – J. M. is a poor mathematician Aug 19 '17 at 13:41
• More efficient & easier to read, or functionally different? – John Joseph M. Carrasco Aug 19 '17 at 13:43
• Well, taking GCDs needs less effort than performing an actual division for large enough integers. – J. M. is a poor mathematician Aug 19 '17 at 13:44
• @JohnJosephM.Carrasco, you mean the $303^{\text{th}}$ prime gives solution ? – Sarah B Aug 19 '17 at 13:45
• I must made an error at some point at the concatenation :( (thanks John !) – Sarah B Aug 19 '17 at 14:10