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.

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

Original entry on oeis.org

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

Views

Author

Arkadiusz Wesolowski, Aug 31 2011

Keywords

Comments

Bisection of A194591: a(n) = A194591(2*n-1).
A194637 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[n = 2*n - 1; k = 0; While[! PrimeQ[n*2^k - 1] && ! PrimeQ[n*2^k + 1], k++]; k, {n, 100}] (* Arkadiusz Wesolowski, Sep 04 2011 *)
    p[n_]:=Module[{c=2n-1,k=0},While[!Or@@PrimeQ[c*2^k+{1,-1}],k++];k]; Array[ p,90] (* Harvey P. Dale, Mar 08 2013 *)