|
|
A040081
|
|
Riesel problem: a(n) = smallest m >= 0 such that n*2^m-1 is prime, or -1 if no such prime exists.
|
|
26
|
|
|
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
|
Hans Riesel, Some large prime numbers. Translated from the Swedish original (Några stora primtal, Elementa 39 (1956), pp. 258-260) by Lars Blomberg.
|
|
MATHEMATICA
|
|
|
PROG
|
(Haskell)
a040081 = length . takeWhile ((== 0) . a010051) .
iterate ((+ 1) . (* 2)) . (subtract 1)
(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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|