login
Least k such that 2^x - k produces primes or negative values of primes for x=1..n and (possibly in absolute value) composite for x=n+1.
0

%I #22 May 13 2013 01:49:59

%S 0,33,111,285,1455,10275,21,75,45,13573477665,232317867705

%N Least k such that 2^x - k produces primes or negative values of primes for x=1..n and (possibly in absolute value) composite for x=n+1.

%C All terms after the first seven are congruent to 15 mod 30.

%C a(n) exists for every n under Dickson's conjecture. [_Charles R Greathouse IV_, Jan 30 2012]

%e There are some numbers (7, 9, 15, 21) for which both abs(2^1 - k) and abs(2^2 - k) are primes. Let k = 33, then 2^1 - 33 is -31, the negative of a prime. 2^2 - 33 is -29, the negative of a prime as well. The absolute value of 2^3 - 33 is composite, hence 33 is a term of the sequence.

%t Table[k = 0; While[i = 1; While[i <= n && PrimeQ[2^i - k], i++]; i <= n || PrimeQ[2^i - k] || Abs[2^i - k] == 1, k++]; k, {n, 9}]

%o (PARI) /* Optimized version, starts from twin primes */

%o list(lim)=my(v=vector(50),least=2,k,p=2);forprime(q=3,lim,if(q-p>2,p=q;next,k=q+2;p=q);for(j=3,least,if(!isprime(abs(2^j-k)),next(2)));my(j=least+1);while(isprime(abs(2^j-k)),j++);if(abs(2^j-k)<2,next);j--;if(!v[j],v[j]=k;print("a("j") = "k);while(v[least],least++)));forstep(i=#v,1,-1,if(v[i],v=vector(i,j,v[j]);break));v \\ _Charles R Greathouse IV_, Jan 30 2012

%Y Cf. A008597.

%K more,nonn

%O 1,2

%A _Arkadiusz Wesolowski_, Jan 26 2012

%E a(10) from _Charles R Greathouse IV_, Jan 30 2012

%E a(11) from _Charles R Greathouse IV_, Jan 31 2012