login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Smallest prime p such that the sum of the predecessor and successor primes is divisible by n.
1

%I #4 Jan 16 2014 09:50:08

%S 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,

%T 79,29,13,149,73,311,17,31,151,71,37,181,59,79,19,283,61,521,43,89,

%U 229,1277,23,197,73,151,79,53,29,109,83,59,149,113,89,127,311,61,383,389,31

%N Smallest prime p such that the sum of the predecessor and successor primes is divisible by n.

%t f[n_] := Block[{k = 2}, While[ Mod[ Prime[k - 1] + Prime[k + 1], n] != 0, k++ ]; Prime[k]]; Array[f, 66]

%t 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 *)

%Y Cf. A000040, A112545, A112681, A112794, A112731, A112789, A112795, A112796, A112804, A112847, A112859, A113155, A113156, A113157, A113158.

%K nonn

%O 1,1

%A _Robert G. Wilson v_, Jan 11 2006