osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Generating a specific list of intsgers


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