OFFSET
1,4
COMMENTS
Somewhat related to the Riesel problem, A040081, the minimum m such that n*2^m-1 is prime.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..16384
EXAMPLE
a(12) = 3 because 12 = 1100 in binary and 97 = 1100001 is the first prime that starts with 1100, needing 3 extra bits.
PROG
(Octave/MATLAB) for n=1:100; m=0; k=0; while(~isprime(n*2^m+k))k=k+1; if k==2^m k=0; m=m+1; end; end; x(n)=m; end; x
(PARI) A108234(n) = { my(m=0, k=0); while(!isprime((n*2^m)+k), k=k+1; if(2^m==k, k=0; m=m+1)); m; }; \\ Antti Karttunen, Dec 16 2017, after Octave/MATLAB code
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Mike Stay, Jun 16 2005
EXTENSIONS
Definition clarified by Antti Karttunen, Dec 16 2017
STATUS
approved