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”).
%I #18 Feb 01 2019 02:51:32
%S 3,3,3,3,13,19,43,3,61,13,29,11,5,53,73,53,23,17,229,13,3,3,17,149,5,
%T 239,5,13,223,71,3,11,31,73,97,43,11,83,149,277,311,383,127,11,3,31,
%U 233,61,61,13,73,107,613,137,53,367,467,53,233,277,17,53,109,449,151,97,13,281,103,233,193,23,7
%N Smallest prime q such that 9^n + q*3^n - 1 is prime.
%H Pierre CAMI, <a href="/A214730/b214730.txt">Table of n, a(n) for n = 1..4000</a>
%o (PFGW and SCRIPTIFY)
%o SCRIPT
%o DIM nn,0
%o DIM qq
%o DIMS tt
%o OPENFILEOUT myfile,a(n).txt
%o LABEL loopn
%o SET nn,nn+1
%o IF nn>4000 THEN END
%o SET qq,1
%o LABEL loopq
%o SET qq,qq+1
%o SETS tt,%d,%d\,;nn;p(qq)
%o PRP (3^nn+p(qq))*3^nn-1,tt
%o IF ISPRP THEN GOTO a
%o IF ISPRIME THEN GOTO a
%o GOTO loopk
%o LABEL a
%o WRITE myfile,tt
%o GOTO loopn
%Y Cf. A214700.
%K nonn
%O 1,1
%A _Pierre CAMI_, Jul 27 2012