A246401 Smallest prime number Q such that the sum prime(n)+prime(n+1)+Q is a prime number.
2, 3, 5, 5, 5, 7, 5, 5, 7, 7, 3, 5, 5, 7, 3, 19, 7, 3, 11, 5, 5, 5, 7, 5, 13, 7, 13, 7, 5, 11, 5, 3, 5, 5, 7, 3, 11, 7, 7, 7, 7, 7, 5, 7, 5, 11, 5, 7, 5, 5, 7, 7, 7, 13, 3, 31, 7, 23, 5, 5, 11, 7, 13, 7, 11, 5, 5, 7, 5, 7, 7, 7, 3, 5, 7, 37, 11, 11, 11, 11, 13
Offset: 1
Keywords
Examples
2+3+2=7 is prime so a(1)=2. 3+5+3=11 is prime so a(2)=3. 5+7+3=15 is composite, and 5+7+5=17 is prime so a(3)=5.
Links
- Pierre CAMI, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A246400.
Programs
-
Mathematica
spn[n_]:=Module[{p=2},While[!PrimeQ[n+p],p=NextPrime[p]];p]; spn/@ (Total/@ Partition[Prime[Range[100]],2,1]) (* Harvey P. Dale, Mar 14 2022 *)
-
PARI
a(n) = t=prime(n)+prime(n+1); k=1; while(!isprime(t+q=prime(k)), k++); q \\ Colin Barker, Aug 25 2014