login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A242085
Smallest k such that (2*k*3^n-1)*2*k*3^n-1 is prime, with k not divisible by 3.
4
1, 2, 1, 2, 14, 2, 8, 5, 4, 5, 4, 40, 5, 29, 5, 7, 5, 19, 13, 1, 37, 34, 13, 2, 1, 17, 13, 2, 7, 28, 34, 26, 61, 2, 41, 43, 2, 10, 118, 52, 4, 4, 11, 7, 20, 139, 35, 11, 4, 29, 40, 8, 44, 7, 64, 37, 47, 175, 14, 23, 142, 23, 5, 32, 104, 110, 4, 26, 47, 25
OFFSET
1,2
COMMENTS
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.
EXAMPLE
(1*2*3^1-1)*1*2*3^1-1=29 so a(1)=1.
(1*2*3^2-1)*1*2*3^2-1=305 composite, (2*2*3^2-1)*2*2*3^2-1=1259 prime so a(2)=2.
MATHEMATICA
sk[n_]:=Module[{k=1, c=2*3^n}, While[Divisible[k, 3]||!PrimeQ[(k*c-1) (k*c)-1], k++]; k]; Array[sk, 70] (* Harvey P. Dale, Aug 05 2014 *)
PROG
(PFGW & SCRIPT)
SCRIPT
DIM n, 0
DIM i
DIM pp
DIMS t
OPENFILEOUT myf, a(n).txt
LABEL loop1
SET n, n+1
SET i, 0
LABEL loop2
SET i, i+1
SETS t, %d, %d\,; n; i
SET pp, (2*i*3^n-1)*2*i*3^n-1
PRP pp, t
IF ISPRP THEN GOTO a
GOTO loop2
LABEL a
WRITE myf, t
GOTO loop1
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, May 04 2014
STATUS
approved