login
A212481
Least k such that k*6^n-1 , k*6^n+1, and 2*k*6^n-1 are prime; that is, twin primes and a Sophie Germain prime.
1
1, 5, 2, 282, 47, 315, 1530, 255, 287, 1577, 4902, 817, 1600, 700, 1540, 422, 9070, 3190, 6860, 6627, 5115, 12462, 2077, 10010, 20515, 13487, 6787, 2235, 23167, 17022, 2837, 15155, 11352, 1892, 16662, 2777, 22640, 4730, 72905, 63665, 25377, 6477, 26537
OFFSET
1,2
LINKS
EXAMPLE
1*6^1-1=5 prime
1*6^1+1=7 prime
2*6^1-1=11 prime so a(1)=1
MATHEMATICA
Table[k = 1; While[! (PrimeQ[k*6^n - 1] && PrimeQ[k*6^n + 1] && PrimeQ[2*k*6^n - 1]), k++]; k, {n, 50}] (* T. D. Noe, Jun 06 2012 *)
lk[n_]:=Module[{k=1, c=6^n}, While[!AllTrue[{k*c-1, k*c+1, 2k*c-1}, PrimeQ], k++]; k]; Array[lk, 50] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jul 29 2015 *)
PROG
PFGW64 and SCRIPTIFY from Primeform Group
Command : pfgw64 -f in.txt
in.txt file :
SCRIPT
DIM nn, 0
DIM kk, 0
DIMS tt
OPENFILEOUT myfile, a(n).txt
LABEL loopn
SET nn, nn+1
IF nn>200 THEN END
SET kk, 0
LABEL loopk
SET kk, kk+1
SETS tt, %d, %d\,; nn; kk
PRP kk*6^nn-1, tt
IF ISPRP THEN GOTO a
IF ISPRIME THEN GOTO a
GOTO loopk
LABEL a
PRP kk*6^nn+1, tt
IF ISPRP THEN GOTO b
IF ISPRIME THEN GOTO b
GOTO loopk
LABEL b
PRP 2*kk*6^nn-1, tt
IF ISPRP THEN GOTO c
IF ISPRIME THEN GOTO c
GOTO loopk
LABEL c
WRITE myfile, tt
GOTO loopn
CROSSREFS
Sequence in context: A266461 A068566 A347426 * A046270 A139207 A137237
KEYWORD
nonn
AUTHOR
Pierre CAMI, Jun 02 2012
STATUS
approved