OFFSET
1,1
COMMENTS
Define Sp sum of log(6*prime(n))^2 from n=1 to N. Define Sk sum of k from n=1 to N. As N increases Sk/Sp tends to 0.6.
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..10000
EXAMPLE
6*1*prime(1)^2-1=23 prime but 25 composite.
6*2*prime(1)^2-1=47 prime but 49 composite.
6*3*prime(1)^2-1=71 prime as 73 so a(1)=3.
MATHEMATICA
Table[k = 1; While[c = 6*k*Prime[n]^2; ! PrimeQ[c - 1] || ! PrimeQ[c + 1], k++ ]; k, {n, 80}] (* Ray Chandler, Oct 08 2005 *)
PROG
(PFGW64 from Primeform group and SCRIPTIFY)
Command pfgw64 -f in.txt
in.txt file :
SCRIPT
DIM nn, 0
DIM kk
DIMS tt
OPENFILEOUT myfile, twin.txt
LABEL loopn
SET nn, nn+1
IF nn>10000 THEN END
SET kk, 0
LABEL loopk
SET kk, kk+1
SETS tt, %d, %d\,; p(nn); kk
PRP 6*kk*p(nn)^2-1, tt
IF ISPRP THEN GOTO a
IF ISPRIME THEN GOTO a
GOTO loopk
LABEL a
PRP 6*kk*p(nn)^2+1, tt
IF ISPRP THEN GOTO b
IF ISPRIME THEN GOTO b
GOTO loopk
LABEL b
WRITE myfile, tt
GOTO loopn
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Sep 18 2005
EXTENSIONS
Extended by Ray Chandler, Oct 08 2005
Corrected, extended and b file by Pierre CAMI, Feb 27 2012
STATUS
approved