A083677 Define f(n, k) to be the concatenation of the first n primes, with n-1 k's inserted between the primes. Then a(n) is the smallest k >= 0 such that f(n, k) is prime, or -1 if no such prime exists.
0, 2, -1, 1, 4, 10, 38, 20, 0, -1, 163, 46, 8, 53, 0, -1, 74, 5, 8, 5, 180, 4, 280, 191, 0, 337, 191, -1, 105, 88, 19, 28, 111, -1, 525, 13, 24, 102, 159, -1, 288, 142, 31, 743, 81, -1, 183, 202, 100, 96, 380, -1, 1227, 5, 113, 123, 20, 23, 0, 48, 148, 438, 52, 144, 128, 297, 206
Offset: 1
Examples
a(4) = 1 because 2030507 is composite and 2131517 is prime.
Links
- C. Rivera, On Solution Of Puzzle 208 .
Crossrefs
Programs
-
Mathematica
fpkQ[k_, n_] := PrimeQ[ FromDigits[ Flatten[ IntegerDigits /@ Insert[ Table[ Prime[i], {i, k}], n, Table[{i}, {i, 2, k}]]]]]; a[1] = 0; a[3] = a[10] = a[16] = a[28] = a[34] = a[40] = a[46] = a[52] = a[70] = a[76] = a[82] = a[88] = a[97] = -1; a[n_] := Block[{k = 0}, While[ fpkQ[n, k] != True, k++ ]; k]; Table[ a[n], {n, 70}] (* Robert G. Wilson v, Dec 11 2004 *)
Extensions
Edited and extended by Robert G. Wilson v, Dec 11 2004
Comments