login
Smallest odd k > 1 such that k*2^n+1 is a prime number.
4

%I #58 Mar 02 2019 02:02:01

%S 3,3,5,7,3,3,5,3,15,13,9,3,5,7,5,21,9,3,11,7,11,25,45,45,5,7,15,13,23,

%T 3,35,43,9,75,59,3,15,15,5,27,3,9,9,15,35,19,27,15,23,7,17,7,51,49,5,

%U 27,29,99,27,31,53,105,9,25,9,3,9,31,23

%N Smallest odd k > 1 such that k*2^n+1 is a prime number.

%C Differs from A057778 only where n is related to a Fermat prime (A019434). - _R. J. Mathar_, Dec 02 2014

%C Records: 3, 5, 7, 15, 21, 25, 45, 75, 99, 105, 127, 249, 321, 363, 411, 421, 535, 823, 1383, 1875, 2375, 2443, 2865, 4063, 4141, 4239, 4623, 5175, 5469, 14319, 15979, 17817, 25925, 30487, 39741, 48055, 49709, 50721, 55367, ... . - _Robert G. Wilson v_, Feb 02 2015

%H Robert G. Wilson v, <a href="/A247479/b247479.txt">Table of n, a(n) for n = 1..10111</a> (first 5150 terms from Pierre CAMI)

%p A247479:= proc(n) local k;

%p for k from 3 by 2 do if isprime(k*2^n+1) then return k fi od

%p end proc:

%p seq(A247479(n),n=1..100); # _Robert Israel_, Dec 01 2014

%t f[n_] := Block[{k = 3, p = 2^n}, While[ !PrimeQ[k*p + 1], k += 2]; k]; Array[f, 70] (* _Robert G. Wilson v_, Jan 29 2015 *)

%o (PFGW & SCRIPT)

%o SCRIPT

%o DIM k

%o DIM n,0

%o DIMS t

%o OPENFILEOUT myf,a(n).txt

%o LABEL loop1

%o SET n,n+1

%o SET k,1

%o LABEL loop2

%o SET k,k+2

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

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

%o IF ISPRP THEN WRITE myf,t

%o IF ISPRP THEN GOTO loop1

%o GOTO loop2

%o (PARI) a(n) = {k = 3; while (! isprime(k*2^n+1), k += 2); k;} \\ _Michel Marcus_, Dec 01 2014

%Y Cf. A035050, A057778, A247202, A253398.

%K nonn

%O 1,1

%A _Pierre CAMI_, Dec 01 2014