Generating a specific list of intsgers

MRAB python at mrabarnett.plus.com
Fri Aug 24 19:39:36 EDT 2018


On 2018-08-24 22:54, Ian Kelly wrote:
> On Fri, Aug 24, 2018 at 3:47 PM <tomusatov at gmail.com> wrote:
>>
>> I am looking for a program able to output a set of integers meeting the following requirement:
>>
>> a(n) is the minimum k > 0 such that n*2^k - 3 is prime, or 0 if no such k exists
>>
>> Could anyone get me started? (I am an amateur)
> 
> Is there some known method of determining that no such k exists? The
> obvious approach would be to try every possible value of k in order.
> The problem is that there are infinitely many possible values of k, so
> the program would not output 0; it would just never complete.
> 
Well, if n <= 0, there is definitely no value of k that could produce a 
prime, but in general...



More information about the Python-list mailing list