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

%I #42 Aug 07 2023 05:21:41

%S 3,3,3,3,7,3,3,5,7,5,3,5,9,5,9,17,7,3,51,17,7,33,13,39,57,11,21,27,7,

%T 213,15,5,31,3,25,17,21,3,25,107,15,33,3,35,7,23,31,5,19,11,21,65,147,

%U 5,3,33,51,77,45,17,69,53,9,3,67,63,43,63,51,27,73,5

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

%C Limit_{N->oo} (Sum_{n=1..N} a(n))/(Sum_{n=1..N} n) = log(2). [[Is there a proof or is this a conjecture? - _Peter Luschny_, Feb 06 2015]]

%C Records: 3, 7, 9, 17, 51, 57, 213, 255, 267, 321, 615, 651, 867, 901, 909, 1001, 1255, 1729, 1905, 2163, 3003, 3007, 3515, 3797, 3825, 4261, 4335, 5425, 5717, 6233, 6525, 6763, 11413, 11919, 12935, 20475, 20869, 25845, 30695, 31039, 31309, 42991, 55999, ... . - _Robert G. Wilson v_, Feb 08 2015

%H Robert G. Wilson v, <a href="/A247202/b247202.txt">Table of n, a(n) for n = 1..10031</a> (first 5000 terms from Pierre CAMI)

%F a(A002235(n)) = 3.

%p f:= proc(n)

%p local k,p;

%p p:= 2^n;

%p for k from 3 by 2 do if isprime(k*p-1) then return k fi od;

%p end proc:

%p seq(f(n), n=1 .. 100); # _Robert Israel_, Feb 05 2015

%t f[n_] := Block[{k = 3, p = 2^n}, While[ !PrimeQ[k*p - 1], k += 2]; k]; Array[f, 70]

%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 GOTO a

%o GOTO loop2

%o LABEL a

%o WRITE myf,t

%o GOTO loop1

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

%Y Cf. A126715, A247479.

%K nonn

%O 1,1

%A _Pierre CAMI_, Nov 25 2014