A244424 Least number k > 0 such that concatenating k consecutive natural numbers beginning with n is prime, or 0 if no such number exists.
0, 1, 1, 4, 1, 2, 1, 2, 179, 0, 1, 2, 1, 4, 5, 28, 1, 3590, 1, 4, 0, 0, 1, 0, 25, 122, 0, 46, 1, 0, 1, 0, 71, 4, 569, 2, 1, 20, 5, 0, 1, 2, 1, 8, 0, 0, 1, 0, 193, 2, 0, 0, 1, 0, 0, 2, 5, 4, 1, 0, 1, 2, 0, 4, 5, 938, 1, 2, 119, 58, 1, 116, 1, 0, 125, 346, 5, 2, 1, 2, 0, 0, 1, 0, 0, 32
Offset: 1
Examples
14 is not prime. 1415 is not prime. 141516 is not prime. 14151617 is prime. Thus a(14) = 4 since 4 consecutive numbers were concatenated.
Programs
-
PARI
a(n) = {p=""; tot=0; for(i=n,5000, p=concat(p,Str(i)); tot++; if(ispseudoprime(eval(p)), return(tot)))} n=1;while(n<100,print1(a(n),", ");n++)
Comments