login
A246401
Smallest prime number Q such that the sum prime(n)+prime(n+1)+Q is a prime number.
1
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,1
EXAMPLE
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.
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 *)
PROG
(PFGW & SCRIPT)
SCRIPT
DIM k
DIM n, 0
OPENFILEOUT myf, a(n).txt
LABEL loop1
SET n, n+1
IF n>10000 THEN END
SET k, 0
LABEL loop2
SET k, k+1
PRP p(n)+p(n+1)+p(k)
IF ISPRP then GOTO a
GOTO loop2
LABEL a
WRITE myf, t
GOTO loop1
(PARI) a(n) = t=prime(n)+prime(n+1); k=1; while(!isprime(t+q=prime(k)), k++); q \\ Colin Barker, Aug 25 2014
CROSSREFS
Cf. A246400.
Sequence in context: A102642 A183228 A133304 * A003660 A065688 A348976
KEYWORD
nonn
AUTHOR
Pierre CAMI, Aug 25 2014
STATUS
approved