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.

A194606 Least k >= 0 such that prime(n)*2^k - 1 or prime(n)*2^k + 1 is prime, or -1 if no such value exists, where prime(n) denotes the n-th prime number.

Original entry on oeis.org

0, 0, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 4, 1, 5, 3, 2, 2, 2, 1, 1, 1, 1, 3, 3, 3, 6, 1, 2, 1, 2, 1, 3, 4, 1, 2, 4, 1, 1, 3, 1, 2, 2, 1, 1, 3, 2, 1, 1, 1, 11, 1, 4, 2, 3, 1, 2, 1, 11, 1, 1, 9, 3, 6, 1, 1, 3, 3, 4, 1, 1, 2, 1, 2, 11, 4, 3, 2, 1, 4, 1, 2, 1, 1
Offset: 1

Views

Author

Arkadiusz Wesolowski, Aug 30 2011

Keywords

Comments

A194607 gives the record values.

Examples

			For n=4, 7*2^0-1 and 7*2^0+1 are composite, but 7*2^1-1=13 is prime, so a(4)=1.
		

Crossrefs

Programs

  • Mathematica
    Table[p = Prime[n]; k = 0; While[! PrimeQ[p*2^k - 1] && ! PrimeQ[p*2^k + 1], k++]; k, {n, 100}] (* Arkadiusz Wesolowski, Sep 04 2011 *)