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!)
 A179013 Greatest k <= n such that 2^n-2^k+1 is prime, or 0 if no such prime exists. 4
 0, 1, 2, 2, 4, 2, 5, 6, 8, 8, 5, 2, 9, 12, 9, 12, 16, 0, 12, 18, 0, 2, 20, 18, 18, 16, 21, 16, 26, 18, 27, 30, 20, 22, 19, 20, 25, 36, 23, 32, 37, 38, 41, 38, 9, 38, 25, 44, 41, 44, 17, 48, 50, 38, 52, 32, 38, 34, 48, 18, 54 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,3 COMMENTS For the first 8300 terms, there are 291 values of n such that a(n)=0 and 6927 values of n with a(n) >= n/2. LINKS Pierre CAMI, Table of n, a(n) for n = 1..10000 MATHEMATICA Table[k=n; While[k>0 && ! PrimeQ[2^n-2^k+1], k--]; k, {n, 100}] PROG (Sage) A179013 = lambda n: next((k for k in reversed([1..floor(log(2**n+1, 2))]) if is_pseudoprime(2**n-2**k+1)), 0) # D. S. McNeil, Jan 12 2011 (PARI) a(n) = {my(k=n); while (!isprime(2^n-2^k+1), k--; if (k==0, return (0))); k; } \\ Michel Marcus, Sep 21 2019 CROSSREFS Cf. A106821, A178993. Sequence in context: A133181 A286280 A290088 * A090397 A328729 A329733 Adjacent sequences:  A179010 A179011 A179012 * A179014 A179015 A179016 KEYWORD nonn AUTHOR Pierre CAMI, Jan 12 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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified August 10 16:56 EDT 2020. Contains 336381 sequences. (Running on oeis4.)