A179289 Smallest index k such that prime(k)*2^n-1 is prime, or zero if there is no prime.
1, 1, 2, 1, 4, 1, 2, 3, 4, 3, 2, 1, 11, 3, 22, 1, 4, 1, 18, 7, 4, 23, 6, 23, 18, 5, 44, 23, 4, 1, 14, 3, 11, 2, 11, 7, 11, 2, 18, 28, 8, 16, 2, 102, 4, 9, 11, 3, 8, 5, 174, 24, 63, 3, 2, 103, 22, 23, 130, 1, 22, 16, 18, 2, 19, 55, 14, 41, 34, 15
Offset: 1
Keywords
Crossrefs
Cf. A126715.
Programs
-
Mathematica
sik[n_]:=Module[{c=2^n,k=1},While[!PrimeQ[Prime[k]*c-1],k++];k]; Array[ sik,70] (* The program will NOT identify cases where no prime satisfies the definition. See the second comment. *) (* Harvey P. Dale, Jan 10 2016 *)
-
Other
SCRIPT / DIM nn,0 / DIM kk / DIMS st / LABEL loopn / SET nn,nn+1 / IF nn>10000 THEN END / SET kk,0 / LABEL loopk / SET kk,kk+1 / SET st,%d,%d,%d\,;nn;kk;p(kk) / PRP p(kk)*2^nn-1 / IF ISPRIME THEN GOTO loopn / GOTO loopk / / This file is the in.txt file / The command is PFGW -f in.txt / The results are in the file pfgw-prime.log for small n / and in the pfgw.log file for greatest n / Program PFGW from Primeform Group /
-
PARI
a(n) = {my(k=1); while (!isprime(prime(k)*2^n-1), k++); k;} \\ Michel Marcus, Sep 16 2019
Formula
a(n) = 1 for n = A000043(k) - 1, the Mersenne exponents minus 1. - T. D. Noe, Mar 23 2011
Comments