login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 59th year, we have over 358,000 sequences, and we’ve crossed 10,300 citations (which often say “discovered thanks to the OEIS”).

Other ways to Give
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A040081 Riesel problem: a(n) = smallest m >= 0 such that n*2^m-1 is prime, or -1 if no such prime exists. 24
2, 1, 0, 0, 2, 0, 1, 0, 1, 1, 2, 0, 3, 0, 1, 1, 2, 0, 1, 0, 1, 1, 4, 0, 3, 2, 1, 3, 4, 0, 1, 0, 2, 1, 2, 1, 1, 0, 3, 1, 2, 0, 7, 0, 1, 3, 4, 0, 1, 2, 1, 1, 2, 0, 1, 2, 1, 3, 12, 0, 3, 0, 2, 1, 4, 1, 5, 0, 1, 1, 2, 0, 7, 0, 1, 1, 2, 2, 1, 0, 3, 1, 2, 0, 5, 6, 1, 23, 4, 0, 1, 2, 3, 3, 2, 1, 1, 0, 1, 1, 10, 0, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

T. D. Noe and Eric Chen, Table of n, a(n) for n = 1..2292 (first 1000 terms from T. D. Noe)

MATHEMATICA

Table[m = 0; While[! PrimeQ[n*2^m - 1], m++]; m, {n, 100}] (* Arkadiusz Wesolowski, Sep 04 2011 *)

PROG

(Haskell)

a040081 = length . takeWhile ((== 0) . a010051) .

iterate ((+ 1) . (* 2)) . (subtract 1)

-- Reinhard Zumkeller, Mar 05 2012

(PARI) a(n)=for(k=0, 2^16, if(ispseudoprime(n*2^k-1), return(k))) \\ Eric Chen, Jun 01 2015

(Python)

from sympy import isprime

def a(n):

m = 0

while not isprime(n*2**m - 1): m += 1

return m

print([a(n) for n in range(1, 88)]) # Michael S. Branicky, Feb 01 2021

CROSSREFS

Cf. A038699 (primes obtained), A050412, A052333.

Cf. A046069 (for odd n)

Cf. A010051, A000079.

Sequence in context: A048105 A335021 A176202 * A239393 A256637 A113063

Adjacent sequences: A040078 A040079 A040080 * A040082 A040083 A040084

KEYWORD

nonn

AUTHOR

David W. Wilson

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 January 2 00:37 EST 2023. Contains 359186 sequences. (Running on oeis4.)