OFFSET
1,2
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..2000
MAPLE
A181537 := proc(n) local p, k; for k from n to 0 by -1 do p := 3^n+3^k+1 ; if isprime(p) then return k; end if; end do: return 0 ; end proc: # R. J. Mathar, Jan 30 2011
MATHEMATICA
gk[n_]:=Module[{k=n, t=3^n+1}, While[!PrimeQ[t+3^k]&&k>0, k--]; k]; Array[ gk, 60] (* Harvey P. Dale, Jan 30 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Jan 29 2011
STATUS
approved