A112686 Smallest prime p such that the sum of the predecessor and successor primes is divisible by n.
3, 5, 23, 7, 5, 23, 3, 7, 29, 5, 31, 23, 79, 13, 73, 7, 151, 29, 59, 11, 61, 31, 229, 23, 73, 79, 29, 13, 149, 73, 311, 17, 31, 151, 71, 37, 181, 59, 79, 19, 283, 61, 521, 43, 89, 229, 1277, 23, 197, 73, 151, 79, 53, 29, 109, 83, 59, 149, 113, 89, 127, 311, 61, 383, 389, 31
Offset: 1
Keywords
Crossrefs
Programs
-
Mathematica
f[n_] := Block[{k = 2}, While[ Mod[ Prime[k - 1] + Prime[k + 1], n] != 0, k++ ]; Prime[k]]; Array[f, 66] With[{prs=Partition[Prime[Range[250]],3,1]},Transpose[Flatten[ Table[ Select[ prs, Divisible[ First[#]+Last[#],n]&,1],{n,70}],1]][[2]]] (* Harvey P. Dale, Jan 16 2014 *)