The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A181523 Greatest k < n such that 3^n - 3^k + 1 is prime or 0 if no such prime exists. 3
0, 1, 2, 2, 4, 5, 6, 4, 7, 9, 6, 10, 3, 10, 12, 0, 16, 17, 12, 17, 12, 3, 20, 22, 21, 17, 22, 0, 0, 22, 30, 29, 11, 31, 32, 18, 17, 35, 35, 37, 12, 25, 38, 14, 15, 12, 42, 37, 35, 42, 42, 36, 40, 52, 54, 16, 48, 57, 35, 58 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
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
Cf. A181515.
Sequence in context: A137413 A010848 A133937 * A353855 A353847 A181537
KEYWORD
nonn
AUTHOR
Pierre CAMI, Jan 29 2011
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 2 15:24 EDT 2024. Contains 373040 sequences. (Running on oeis4.)