login
A198291
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
0, 33, 111, 285, 1455, 10275, 21, 75, 45, 13573477665, 232317867705
OFFSET
1,2
COMMENTS
All terms after the first seven are congruent to 15 mod 30.
a(n) exists for every n under Dickson's conjecture. [Charles R Greathouse IV, Jan 30 2012]
EXAMPLE
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.
MATHEMATICA
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}]
PROG
(PARI) /* Optimized version, starts from twin primes */
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
CROSSREFS
Cf. A008597.
Sequence in context: A296125 A297429 A039520 * A044284 A044665 A140161
KEYWORD
more,nonn
AUTHOR
EXTENSIONS
a(10) from Charles R Greathouse IV, Jan 30 2012
a(11) from Charles R Greathouse IV, Jan 31 2012
STATUS
approved