login
Least prime p > 3 such that 2^n + p*2^floor((n+1)/2) - 1 is prime.
2

%I #14 Feb 22 2013 21:39:12

%S 5,5,13,7,5,5,7,7,11,13,13,11,5,11,37,11,5,23,13,47,89,13,19,19,11,7,

%T 19,23,17,13,19,43,29,79,61,17,191,43,337,53,29,17,13,13,29,11,19,11,

%U 11,13,43,163,29,13,7,53,23,97,31,29,41,83,79,23,191,97

%N Least prime p > 3 such that 2^n + p*2^floor((n+1)/2) - 1 is prime.

%H Pierre CAMI, <a href="/A206553/b206553.txt">Table of n, a(n) for n = 1..10000</a>

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

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

%o PFGW64 from Primeform group and SRYPTIFY

%o command : pfgw64 -f in.txt

%o in.txt file :

%o SCRIPT

%o DIM kk

%o DIM nn,0

%o DIM mm

%o DIMS tt

%o OPENFILEOUT myfil,prem.txt

%o LABEL loopn

%o SET nn,nn+1

%o IF nn>10000 THEN END

%o IF nn%2==0 THEN SET mm,nn/2

%o IF nn%2==1 THEN SET mm,nn/2+1

%o SET kk,2

%o LABEL loopk

%o SET kk,kk+1

%o SETS tt,%d,%d,%d,%d\ ;nn;kk;p(kk);mm

%o PRP (2^(nn-mm)+p(kk))*2^mm-1,tt

%o IF ISPRP THEN GOTO a

%o IF ISPRIME THEN GOTO a

%o GOTO loopk

%o LABEL a

%o WRITE myfil,tt

%o GOTO loopn

%o (Haskell)

%o a206553 n = head [p | p <- drop 2 a000040_list,

%o a010051 (2^n + p*2^(div (n+1) 2) - 1) == 1]

%o -- _Reinhard Zumkeller_, Feb 10 2012

%Y Cf. A206554.

%Y Cf. A010051, A000040.

%K nonn

%O 1,1

%A _Pierre CAMI_, Feb 09 2012