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

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A057160 Smallest value of k for which the expression k*2^(2^n-1)-1 is prime. 0

%I #26 May 27 2022 15:36:41

%S 3,2,1,1,4,1,6,1,90,111,244,139,880,309,22263,56083,130141,49905

%N Smallest value of k for which the expression k*2^(2^n-1)-1 is prime.

%F a(n) = A053989(A058891(n+1)). - _Pontus von Brömssen_, May 27 2022

%e a(1)=2 because 2*2^(2^1-1)-1 = 2*2^1-1 = 3 which is prime. - _Sean A. Irvine_, May 25 2022

%e a(4)=4 because 4*2^(2^4-1)-1 = 4*2^15-1 = 4*32768-1 = 131071 which is prime.

%t 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 *)

%o (Python)

%o from sympy import isprime

%o def a(n):

%o k, c = 1, 2**(2**n-1)

%o while not isprime(k*c - 1): k += 1

%o return k

%o print([a(n) for n in range(1, 12)]) # _Michael S. Branicky_, May 25 2022

%o (PARI) a(n) = my(k=1); while (!isprime(k*2^(2^n-1)-1), k++); k; \\ _Michel Marcus_, May 27 2022

%Y Cf. A053989, A058891, A077585 (2^(2^n-1)-1).

%K nonn,more

%O 0,1

%A _Steven Harvey_, Sep 14 2000

%E Offset and a(1) corrected by _Sean A. Irvine_, May 25 2022

%E a(0) prepended by _Michel Marcus_, May 27 2022

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 April 16 05:35 EDT 2024. Contains 371697 sequences. (Running on oeis4.)