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!)
A178993 Greatest k <= n such that 2^n+2^k+1 or 2^n+2^k-1 or 2^n-2^k+1 or 2^n-2^k-1 is prime 4
1, 2, 3, 4, 4, 6, 7, 7, 8, 8, 6, 12, 12, 13, 15, 16, 16, 18, 18, 19, 17, 16, 20, 21, 18, 21, 25, 23, 26, 30, 30, 31, 28, 32, 34, 34, 36, 36, 38, 38, 39, 41, 41, 43, 43, 43, 42, 45, 41, 48, 46, 48, 50, 45, 52, 55, 55, 54, 48, 60, 56, 61, 56, 60, 64, 64, 66, 66, 61, 67, 66, 66, 68, 72, 66, 67, 76, 76, 72, 73 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
when k=n and 2^n+2^k-1 is prime then the prime is a Mersenne prime and n+1 is prime
LINKS
EXAMPLE
2^1+2^1+1=5 prime as 2^1+2^1-1=3 Mersenne prime so k(1)=1
2^2+2^2-1=7 Mersenne prime so k(2)=2
2^3+2^3+1=17 prime so k(3)=3
2^4+2^4-1=31 Mersenne prime so k(4)=4
2^5+2^4-1=47 prime so k(5)=4
MATHEMATICA
f[n_] := Block[{k = n}, While[ !PrimeQ[2^n + 2^k + 1] && !PrimeQ[2^n + 2^k - 1] && !PrimeQ[2^n - 2^k + 1] && !PrimeQ[2^n - 2^k - 1], k--]; k]; Array[f, 80]
gk[n_]:=Module[{c=2^n, k=n}, While[NoneTrue[{c+2^k+1, c+2^k-1, c-2^k+1, c-2^k- 1}, PrimeQ], k--]; k]; Array[gk, 80] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Mar 05 2019 *)
CROSSREFS
Sequence in context: A066981 A130043 A089266 * A193768 A361784 A361318
KEYWORD
nonn
AUTHOR
Pierre CAMI, Jan 03 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 May 23 09:59 EDT 2024. Contains 372760 sequences. (Running on oeis4.)