A380092 Number of consecutive primes after prime(n) before their concatenation fails to produce a prime.
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0
Offset: 1
Examples
a(1) = 1 since prime(1) = 2 can be concatenated with the next prime 3 to 23 which is prime, but the next concatenation with 5 is 235 which is not prime. a(2) = 0 since prime(2) = 3 but concatenating the next prime 5 is 35 which is not prime. a(11) = 2 since prime(11) = 31 concatenates: 3137 is prime, 313741 is prime, but 31374143 is not prime.
Programs
-
Mathematica
a[n_] := Block[{k = 0, p = Prime@ n}, While[ PrimeQ[ FromDigits[ Flatten[ IntegerDigits[ NextPrime[p, Range[0, k]]]]]], k++]; --k]; Array[a, 105]
Formula
a(n) = 0 iff (p_(n+1) - p_n)/2 == 1 (mod 2).
a(n) > 0 iff n is in A030459.