login
Smallest k such that (2*k*3^n+1)*2*k*3^n-1 is prime, with k not divisible by 3.
4

%I #15 Mar 04 2023 13:04:32

%S 1,7,1,4,1,8,11,5,20,1,16,10,1,8,2,5,5,5,2,50,20,128,11,13,23,5,52,2,

%T 20,38,1,5,11,1,14,22,10,31,2,35,8,107,112,103,80,22,40,104,20,1,29,

%U 40,1,61,77,8,41,62,1,5,46,20,35,29,68,23,85,49,58,23

%N Smallest k such that (2*k*3^n+1)*2*k*3^n-1 is prime, with k not divisible by 3.

%C Conjectures: the ratio a(n)/n is always <10 and sum(a(n)/n)/N for n=1 to N tends to 1 as N tends to infinity.

%H Pierre CAMI, <a href="/A242132/b242132.txt">Table of n, a(n) for n = 1..4000</a>

%t sk[n_]:=Module[{k=1},While[Mod[k,3]==0||!PrimeQ[(2k 3^n+1)2 k 3^n-1],k++]; k]; Array[sk,70] (* _Harvey P. Dale_, Mar 04 2023 *)

%o (PFGW & SCRIPT)

%o SCRIPT

%o DIM n, 0

%o DIM i

%o DIM pp

%o DIMS t

%o OPENFILEOUT myf, a(n).txt

%o LABEL loop1

%o SET n, n+1

%o SET i, 0

%o LABEL loop2

%o SET i, i+1

%o SETS t, %d, %d\,; n; i

%o SET pp, (2*i*3^n+1)*2*i*3^n-1

%o PRP pp, t

%o IF ISPRP THEN GOTO a

%o GOTO loop2

%o LABEL a

%o WRITE myf, t

%o GOTO loop1

%o (PARI) a(n) = {k = 1; while (! isprime((2*k*3^n+1)*2*k*3^n-1) || !(k % 3), k++); k;} \\ _Michel Marcus_, May 05 2014

%Y Cf. A242085, A242131, A242133.

%K nonn

%O 1,2

%A _Pierre CAMI_, May 05 2014