A057160 Smallest value of k for which the expression k*2^(2^n-1)-1 is prime.
3, 2, 1, 1, 4, 1, 6, 1, 90, 111, 244, 139, 880, 309, 22263, 56083, 130141, 49905
Offset: 0
Examples
a(1)=2 because 2*2^(2^1-1)-1 = 2*2^1-1 = 3 which is prime. - _Sean A. Irvine_, May 25 2022 a(4)=4 because 4*2^(2^4-1)-1 = 4*2^15-1 = 4*32768-1 = 131071 which is prime.
Programs
-
Mathematica
svk[n_]:= Module[{k = 1, c = 2^(2^n-1)}, While[!PrimeQ[k*c-1],k++];k]; Join[{2}, svk /@ Range[17]] (* Harvey P. Dale, Feb 03 2021, adjusted for new offset by Michael De Vlieger, May 25 2022 *)
-
PARI
a(n) = my(k=1); while (!isprime(k*2^(2^n-1)-1), k++); k; \\ Michel Marcus, May 27 2022
-
Python
from sympy import isprime def a(n): k, c = 1, 2**(2**n-1) while not isprime(k*c - 1): k += 1 return k print([a(n) for n in range(1, 12)]) # Michael S. Branicky, May 25 2022
Formula
Extensions
Offset and a(1) corrected by Sean A. Irvine, May 25 2022
a(0) prepended by Michel Marcus, May 27 2022