login
Smallest odd number k>1 such that k*2^prime(n)-1 is also prime.
1

%I #10 Apr 25 2016 11:50:04

%S 3,3,7,3,3,9,7,51,13,7,15,21,15,3,31,147,45,69,43,73,15,69,91,19,51,

%T 81,3,25,9,85,103,55,169,225,109,145,15,103,615,69,259,69,63,45,285,

%U 471,9,255,169,489,69,273,427,43,391,169,201,21

%N Smallest odd number k>1 such that k*2^prime(n)-1 is also prime.

%C If prime(n) is a Mersenne prime exponent then 2^prime(n)-1 is a prime < k*2^prime(n)-1.

%H Pierre CAMI, <a href="/A249806/b249806.txt">Table of n, a(n) for n = 1..1000</a>

%p 3*2^2-1=11 prime so a(1)=3.

%p 3*2^3-1=23 prime so a(2)=3.

%p 3*2^5-1=95 composite, 5*2^5-1=159 composite, 7*2^5-1=223 prime so a(3)=7.

%t a249806[n_Integer] := Catch[Module[{k}, For[k = 3, k < 10^5, k += 2, If[PrimeQ[k*2^Prime[n] - 1], Throw[k], 0]]]]; a249806 /@ Range[120] (* _Michael De Vlieger_, Nov 11 2014 *)

%o (PFGW & SCRIPT)

%o SCRIPT

%o DIM j,0

%o DIM k

%o DIM n

%o DIMS t

%o OPENFILEOUT myf,a(n).txt

%o LABEL loop1

%o SET j,j+1

%o IF j>1000 THEN END

%o SET k,p(j)

%o SET n,1

%o LABEL loop2

%o SET n,n+2

%o SETS t,%d,%d,%d\,;j;k;n

%o PRP n*2^k-1,t

%o IF ISPRP THEN GOTO a

%o GOTO loop2

%o LABEL a

%o WRITE myf,t

%o GOTO loop1

%o (PARI) s=[]; forprime(p=2, 500, k=3; q=2^p; while(!ispseudoprime(k*q-1), k+=2); s=concat(s, k)); s \\ _Colin Barker_, Nov 06 2014

%Y Cf. A135434.

%K nonn

%O 1,1

%A _Pierre CAMI_, Nov 06 2014