OFFSET
1,3
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..2000
MAPLE
A181523 := proc(n) local p, k; for k from n-1 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:
seq(A181523(n), n=1..80) ; # R. J. Mathar, Jan 31 2011
PROG
(Sage)
A181523 = lambda n: next((k for k in reversed(IntegerRange(1, n)) if is_pseudoprime(3^n-3^k+1)), 0) # D. S. McNeil, Jan 31 2011
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Jan 29 2011
STATUS
approved