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

%I #58 Aug 16 2022 16:06:24

%S 1,2,2,4,4,6,6,7,0,8,6,12,8,12,10,16,0,18,18,18,12,10,16,21,0,15,22,

%T 22,0,30,20,24,0,32,34,21,8,3,38,36,16,26,0,43,0,43,42,43,0,48,46,38,

%U 0,28,44,55,0,54,0,60,56,28,56,60,64,63,48,60,0

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

%C Up to n=6600, a(n) = 0 for 867 values of n and a(n) >= n/2 for 4931 values of n.

%C When n+1 is a prime in A000043 and k=n, then 2^n+2^k-1 = 2^(n+1)-1 is a Mersenne Prime.

%H Pierre CAMI, <a href="/A179291/b179291.txt">Table of n, a(n) for n = 1..10000</a>

%t Table[k=n; While[k>0 && ! PrimeQ[2^n+2^k-1], k--]; k, {n, 100}] (* _T. D. Noe_, Jan 12 2011 *)

%o (PARI) A179291(n)={forstep(i=n,1,-1,if(isprime(2^n+2^i-1),return(i)));return(0)} \\ _Michael B. Porter_, Jan 12 2011

%Y Cf. A106821, A178993, A179013, A179760, A181498, A181514, A181408, A181409.

%K nonn

%O 1,2

%A _Pierre CAMI_, Jan 12 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 April 19 16:21 EDT 2024. Contains 371794 sequences. (Running on oeis4.)