cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

Original entry on oeis.org

0, 33, 111, 285, 1455, 10275, 21, 75, 45, 13573477665, 232317867705
Offset: 1

Views

Author

Arkadiusz Wesolowski, Jan 26 2012

Keywords

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]

Examples

			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.
		

Crossrefs

Cf. A008597.

Programs

  • 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}]
  • 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

Extensions

a(10) from Charles R Greathouse IV, Jan 30 2012
a(11) from Charles R Greathouse IV, Jan 31 2012