OFFSET
1,1
COMMENTS
For A014574(n) < 1000000, the largest value of a(n) is 79 and 30.6% of all a(n) are 2.
EXAMPLE
a(1) = 2, because 2*4 = 8 is adjacent to prime 7.
a(2) = 2, because 2*6 = 12 is adjacent to prime 11.
a(3) = 2, because 2*12 = 24 is adjacent to prime 23.
a(4) = 2, because 2*18 = 36 is adjacent to prime 37.
a(5) = 2, because 2*30 = 60 is adjacent to prime 59.
a(10) = 5, because 5*108 = 540 is adjacent to prime 541.
MATHEMATICA
twinMids = Select[Range[3500], And @@ PrimeQ[# + {-1, 1}] &]; leastPrime[n_] := Module[{p = 2}, While[!Or @@ PrimeQ[p * n + {-1, 1}], p = NextPrime[p]]; p]; leastPrime /@ twinMids (* Amiram Eldar, Jan 21 2020 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Dmitry Kamenetsky, Jan 20 2020
STATUS
approved