login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Smallest number k such that (k^2)*2^(2*n+1)-1 is a prime number.
2

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

%S 2,1,1,1,4,2,1,2,1,1,3,5,8,4,2,1,7,5,10,5,6,3,19,71,46,23,14,7,4,2,1,

%T 3,15,13,38,19,10,5,28,14,7,8,4,2,1,11,14,7,6,3,8,4,2,1,3,54,27,17,11,

%U 16,8,4,2,1,38,19,52,26,13,15,11

%N Smallest number k such that (k^2)*2^(2*n+1)-1 is a prime number.

%C If k=1 then 2*n+1 is a Mersenne exponent.

%H Pierre CAMI, <a href="/A252733/b252733.txt">Table of n, a(n) for n = 0..2500</a>

%e 2*2^1-1=3 prime so a(0)=2.

%e 1*2^3-1=7 prime so a(1)=1.

%e 1*2^5-1=31 prime so a(2)=1.

%t Table[k=1; While[Not[PrimeQ[k^2*2^(2*n+1)-1]],k++]; k,{n,0,100}] (* _Vaclav Kotesovec_, Dec 21 2014 *)

%o (PFGW & SCRIPT)

%o SCRIPT

%o DIM n,0

%o DIM k

%o OPENFILEOUT myf,a(n).txt

%o LABEL loop1

%o SET n,n+1

%o SET k,0

%o LABEL loop2

%o SET k,k+1

%o PRP k^2*2^(2*n+1)-1

%o IF ISPRP THEN GOTO a

%o GOTO loop2

%o LABEL a

%o WRITE myf,k

%o GOTO loop1

%K nonn

%O 0,1

%A _Pierre CAMI_, Dec 21 2014