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!)
A194603 Smallest prime either of the form n*2^k - 1 or n*2^k + 1, k >= 0, or 0 if no such prime exists. 13
2, 3, 2, 3, 11, 5, 13, 7, 17, 11, 23, 11, 53, 13, 29, 17, 67, 17, 37, 19, 41, 23, 47, 23, 101, 53, 53, 29, 59, 29, 61, 31, 67, 67, 71, 37, 73, 37, 79, 41, 83, 41, 173, 43, 89, 47, 751, 47, 97, 101, 101, 53, 107, 53, 109, 113, 113, 59, 1889, 59, 487, 61, 127 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Primes arising from A194591 (or 0 if no such prime exists).
Many of these terms are in A093868.
LINKS
Arkadiusz Wesolowski, Table of n, a(n) for n = 1..1000
EXAMPLE
For n=7, 7*2^0-1 and 7*2^0+1 are composite, but 7*2^1-1=13 is prime, so a(7)=13.
MATHEMATICA
Table[k = 0; While[! PrimeQ[a = n*2^k - 1] && ! PrimeQ[a = n*2^k + 1], k++]; a, {n, 100}] (* Arkadiusz Wesolowski, Sep 04 2011 *)
n2k[n_]:=Module[{k=0}, While[NoneTrue[n*2^k+{1, -1}, PrimeQ], k++]; SelectFirst[ n*2^k+{-1, 1}, PrimeQ]]; Array[n2k, 70] (* The program uses the NoneTrue and SelectFirst functions from Mathematica version 10 *) (* Harvey P. Dale, Jun 03 2015 *)
CROSSREFS
Sequence in context: A251090 A078331 A093868 * A183465 A223168 A322404
KEYWORD
nonn
AUTHOR
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 March 29 08:13 EDT 2024. Contains 371265 sequences. (Running on oeis4.)