OFFSET
1,3
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..2000
MAPLE
A181515 := proc(n) local p, k; for k from n-1 to 1 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
Table[Max[Flatten[Position[3^n-3^Range[n-1]-1, _?PrimeQ]]], {n, 60}]/.-\[Infinity]->0 (* Harvey P. Dale, Feb 12 2011 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Jan 29 2011
STATUS
approved