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!)
A181515 Greatest k < n such that 3^n - 3^k - 1 is prime, or 0 if no such prime exists. 4

%I #15 Jan 19 2019 22:18:33

%S 0,1,2,3,2,4,0,7,8,4,7,10,12,7,10,12,13,15,17,17,20,16,15,23,17,8,3,

%T 27,24,22,19,23,25,23,30,35,13,31,22,30,21,39,17,37,32,40,42,45,45,43,

%U 45,50,50,48,34,53,56,0,54,25

%N Greatest k < n such that 3^n - 3^k - 1 is prime, or 0 if no such prime exists.

%H Pierre CAMI, <a href="/A181515/b181515.txt">Table of n, a(n) for n = 1..2000</a>

%p 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

%t Table[Max[Flatten[Position[3^n-3^Range[n-1]-1,_?PrimeQ]]],{n,60}]/.-\[Infinity]->0 (* _Harvey P. Dale_, Feb 12 2011 *)

%K nonn

%O 1,3

%A _Pierre CAMI_, Jan 29 2011

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 May 11 17:45 EDT 2024. Contains 372410 sequences. (Running on oeis4.)