The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A106821 Greatest k < n such that 2^n - 2^k -1 is prime or 0 if no such prime exists. 5
 0, 0, 2, 3, 3, 5, 0, 7, 7, 5, 3, 9, 11, 13, 0, 11, 11, 17, 11, 19, 17, 16, 0, 21, 13, 9, 0, 23, 17, 18, 0, 31, 23, 28, 31, 34, 0, 33, 0, 38, 31, 37, 0, 30, 43, 17, 31, 45, 41, 37, 7, 47, 41, 44, 0, 42, 55, 0, 27, 42, 43, 61, 0, 29 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,3 LINKS Pierre CAMI, Table of n, a(n) for n = 1..10000 EXAMPLE 2^3 - 2^2 -1 = 3 prime so a(3)=2 2^4 - 2^3 -1 = 7 prime so a(4)=3 2^5 - 2^3 -1 = 23 prime so a(5)=3 2^6 - 2^5 -1 = 31 prime so a(6)=5 MATHEMATICA kk[n_]:=Module[{k=n-1, n2=2^n}, While[!PrimeQ[n2-2^k-1]&&k>0, k--]; k]; Array[kk, 70] (* Harvey P. Dale, Mar 09 2012 *) PROG (PARI) for(n=1, 1000, q=1;   forstep(k=n-1, 0, -1,     if(isprime(2^n-2^k-1),       q=0;       print1(k, ", ");       break()      )   );   if(q, print1(0, ", ")) ) /* Joerg Arndt, Jan 14 2011 */ CROSSREFS Sequence in context: A118963 A127641 A328730 * A065863 A049272 A181483 Adjacent sequences:  A106818 A106819 A106820 * A106822 A106823 A106824 KEYWORD nonn AUTHOR Pierre CAMI, May 18 2005 EXTENSIONS Extra numbers to right of data removed from b-file by Andrew Howroyd, Feb 23 2018 STATUS approved

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

Last modified September 30 17:12 EDT 2020. Contains 337440 sequences. (Running on oeis4.)