login
Least k > n-1 such that 4^n + 2^k - 1 is a prime number.
2

%I #19 Feb 24 2018 11:55:34

%S 1,2,3,4,6,6,12,9,10,10,27,13,15,22,16,16,18,19,39,22,22,43,24,24,48,

%T 26,28,43,32,38,75,33,36,58,35,57,55,47,48,52,54,72,52,51,72,54,72,53,

%U 64,62,52,52,63,60,55,60,316,70,63,68,64,96,66,115,66,92

%N Least k > n-1 such that 4^n + 2^k - 1 is a prime number.

%C As n increases k is on average 1.43*n.

%H Pierre CAMI, <a href="/A210733/b210733.txt">Table of n, a(n) for n = 1..3867</a>

%e 4^1+2^1-1=5 prime so a(1)=1.

%e 4^2+2^2-1=19 prime so a(2)=2.

%e 4^3+2^3-1=71 prime so a(3)=3.

%t Table[k = n; While[! PrimeQ[4^n + 2^k - 1], k++]; k, {n, 100}] (* _T. D. Noe_, May 16 2012 *)

%o (PFGW64 and SCRIPTIFY)

%o Command : PFGW64 -f in.txt

%o in.txt file :

%o SCRIPT

%o DIM nn,0

%o DIM kk

%o DIMS tt

%o OPENFILEOUT myfile,a(n).txt

%o LABEL loopn

%o SET nn,nn+1

%o SET kk,nn-1

%o LABEL loopk

%o SET kk,kk+1

%o SETS tt,%d,%d\,;nn;kk

%o PRP 4^nn+2^kk-1,tt

%o IF ISPRP THEN GOTO a

%o IF ISPRIME THEN GOTO a

%o GOTO loopk

%o LABEL a

%o WRITE myfile,tt

%o GOTO loopn

%K nonn

%O 1,2

%A _Pierre CAMI_, May 10 2012

%E Missing a(2103) inserted into b-file by _Andrew Howroyd_, Feb 24 2018