login
A245016
Smallest number k such that P=k*prime(n+1)*(prime(n)-1)+1, Q=k*prime(n+1)*P+1, R=(prime(n)-1)*Q+1 and P, Q, and R are all prime numbers.
1
10, 1986, 6, 696, 200, 222, 6510, 1050, 630, 756, 56, 726, 798, 126, 114, 6600, 166, 62, 1422, 12034, 170, 34944, 1410, 912, 2880, 2558, 1200, 9350, 5148, 1506, 5040, 384, 2250, 1680, 114, 396, 3248, 2310, 18930, 30810, 938, 1176, 1020, 2022, 8500, 142, 1760, 1218
OFFSET
2,1
COMMENTS
Q= x^2 + x + p(n) with x = k*p(n+1)*(p(n)-1), a polynomial prime.
MATHEMATICA
snk[n_]:=Module[{pr=Prime[n], pr1=Prime[n+1], k=1, p, q, r}, p=k*pr1*(pr-1)+1; q=k*pr1*p+1; r=(pr-1)*q+1; While[!AllTrue[{p, q, r}, PrimeQ], k++; p=k*pr1*(pr-1)+1; q=k*pr1*p+1; r=(pr-1)*q+1; ]; k]; Array[snk, 50, 2] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Dec 09 2014 *)
PROG
(PFGW & SCRIPT)
SCRIPT
DIM i
DIM j
DIM k
DIM n, 1
OPENFILEOUT myf, a(n)
LABEL loop1
SET n, n+1
SET k, 0
SET i, p(n)-1
SET j, p(n+1)
LABEL loop2
SET k, k+2
PRP k*i*j+1
IF ISPRP THEN GOTO a
GOTO loop2
LABEL a
PRP k*j*(k*i*j+1)+1
IF ISPRP THEN GOTO b
GOTO loop2
LABEL b
PRP i*(k*j*(k*i*j+1)+1)+1
IF ISPRP THEN GOTO c
GOTO loop2
LABEL c
WRITE myf, k
GOTO loop1
CROSSREFS
Sequence in context: A024138 A261603 A346543 * A294174 A177359 A228294
KEYWORD
nonn
AUTHOR
Pierre CAMI, Sep 17 2014
STATUS
approved