OFFSET
1,1
LINKS
Eric Chen, Table of n, a(n) for n = 1..2292 (first 1000 terms from T. D. Noe)
Matteo Cati and Dmitrii V. Pasechnik, A database of constructions of Hadamard matrices, arXiv:2411.18897 [math.CO], 2024. See p. 14.
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
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
KEYWORD
nonn
AUTHOR
STATUS
approved