login
Smallest k such that 6*k*A121940(n)-1 and 6*k*A121940(n)+1 are twin primes.
0

%I #21 Jan 29 2020 05:52:34

%S 1,2,2,15,36,10,13,26,30,228,24,138,520,59,110,456,700,670,146,300,

%T 390,53,2335,340,159,340,65,475,785,1145,759,3557,490,169,990,1527,

%U 704,3379,1426,1927,2397,600,1603,4809,9815,58,35,364,361,123,2197,4054,1867,1827,5048

%N Smallest k such that 6*k*A121940(n)-1 and 6*k*A121940(n)+1 are twin primes.

%e A121940(1)=7, 6*1*7-1=41, 41 and 43 are twin primes so a(1)=1.

%e A121940(2)=91, 6*2*91-1=1091, 1091 and 1093 are twin primes so a(2)=2.

%o (PFGW Script)

%o SCRIPT

%o DIM i,0

%o DIM j

%o DIM k,0

%o DIM n,1

%o OPENFILEOUT myf,a(n).txt

%o OPENFILEIN maf,a002476.txt

%o LABEL a

%o SET i,i+1

%o IF i>100 THEN END

%o GETNEXT j,maf

%o SET n,n*j

%o SET k,0

%o LABEL b

%o SET k,k+1

%o PRP k*6*n+1,k

%o IF ISPRP THEN GOTO c

%o GOTO b

%o LABEL c

%o PRP k*6*n-1,k

%o IF ISPRP THEN GOTO d

%o GOTO b

%o LABEL d

%o WRITE myf,k

%o GOTO a

%o (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

%Y Cf. A001359, A002476, A006512, A121940, A173937, A329336, A329916.

%K nonn

%O 1,2

%A _Pierre CAMI_, Nov 24 2019