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.

A194591 Least k >= 0 such that n*2^k - 1 or n*2^k + 1 is prime, or -1 if no such value exists.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 1, 0, 1, 0, 2, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 5, 0, 3, 0, 1, 1, 1, 0, 2, 0, 1, 0, 2, 0, 2, 0, 1, 1, 2, 0, 1, 0, 1, 0, 1, 0, 4, 1
Offset: 1

Views

Author

Arkadiusz Wesolowski, Aug 29 2011

Keywords

Comments

Fred Cohen and J. L. Selfridge showed that a(n) = -1 infinitely often.
a(n) = 0 iff n is in A045718.

Examples

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

Crossrefs

Cf. A217892 and A194600 (indices and values of the records).

Programs

  • Mathematica
    Table[k = 0; While[! PrimeQ[n*2^k - 1] && ! PrimeQ[n*2^k + 1], k++]; k, {n, 100}] (* T. D. Noe, Aug 29 2011 *)

Formula

If a(n)>0, then a(2n)=a(n)-1.