login
A329916
Smallest k such that 6*k*A057130(n)-1 and 6*k*A057130(n)+1 are twin primes.
1
1, 2, 3, 23, 11, 18, 77, 46, 84, 76, 22, 30, 3, 107, 26, 198, 136, 23, 236, 284, 167, 269, 381, 405, 379, 374, 620, 481, 606, 505, 163, 1414, 348, 639, 1696, 1429, 850, 2050, 740, 117, 362, 35, 3961, 72, 1307, 1816, 9410, 5705, 972, 368, 5083, 4387, 3296, 6039
OFFSET
1,2
COMMENTS
A057130 gives the product of prime numbers (-1 mod 6) in the order of occurrence.
EXAMPLE
A057130(1)=5, 6*1*5-1=29, and 29 and 31 are twin primes, so a(1)=1.
A057130(2)=55, 6*2*55-1=659, and 659 and 661 are twin primes, so a(2)=2.
PROG
(PFGW Script)
SCRIPT
DIM i, 0
DIM j
DIM k
DIM n, 1
OPENFILEOUT myf, a(n).txt
OPENFILEIN maf, a007528.txt
LABEL a
SET i, i+1
IF i>100 THEN END
GETNEXT j, maf
SET n, n*j
SET k, 0
LABEL b
SET k, k+1
PRP k*6+1, k
IF ISPRP THEN GOTO c
GOTO b
LABEL c
PRP k*6*n-1, k
IF ISPRP THEN GOTO d
GOTO b
LABEL d
WRITE myf, k
GOTO a
(PARI) lista(nn) = {my(pp = 1); forprime (p = 1, nn, if (Mod(p, 6) == -1, pp *= p; my(k=1); while (!isprime(6*k*pp-1) || !isprime(6*k*pp+1), k++); print1(k, ", "); ); ); } \\ Michel Marcus, Nov 25 2019
KEYWORD
nonn
AUTHOR
Pierre CAMI, Nov 24 2019
STATUS
approved