OFFSET
1,1
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..45
EXAMPLE
2 first prime, 2+2=4 composite.
3 prime, 3+2=5 prime, 3^2+3-1=11 prime, 3^2+3+1=13 prime, 3^2+3*3+1=19 prime, 3^2+3*3+3=21 composite.
5 prime, 5+2=7 prime, 5^2+5-1=29 prime, 5^2+5+1=31 prime, 5^2+3*5+1=41 prime, 5^2+3*5+3=43 prime so a(1)=5
MATHEMATICA
Select[Prime[Range[50890000]], AllTrue[{#+2, #^2+#-1, #^2+#+1, #^2+3#+1, #^2+3#+3}, PrimeQ]&] (* Harvey P. Dale, Aug 13 2021 *)
PROG
(PFGW & SCRIPT)
twin.txt file with the smallest of twin pairs.
SCRIPT
DIM m
DIM n
OPENFILEIN maf, twin.txt
OPENFILEOUT myf, a.txt
LABEL loop
GETNEXT n, maf
SET m, n*(n+1)-1
PRP m
IF ISPRP THEN GOTO a
GOTO loop
LABEL a
PRP m+2
IF ISPRP THEN GOTO b
GOTO loop
LABEL b
SET n, n+2
SET m, n*(n-1)-1
PRP m
IF ISPRP THEN GOTO c
GOTO loop
LABEL c
SET m, m+2
PRP m
SET n, n-2
IF ISPRP THEN WRITE myf, n
GOTO loop
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Jun 27 2016
STATUS
approved