Generating a specific list of intsgers

Steven D'Aprano steve+comp.lang.python at pearwood.info
Fri Aug 24 23:56:28 EDT 2018


On Fri, 24 Aug 2018 14:40:00 -0700, tomusatov 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)


That's more a maths question than a programming question. Find out how to 
tackle it mathematically, and then we can code it.



-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson




More information about the Python-list mailing list