A194591 Least k >= 0 such that n*2^k - 1 or n*2^k + 1 is prime, or -1 if no such value exists.
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
Keywords
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.
Links
- Arkadiusz Wesolowski, Table of n, a(n) for n = 1..1000
- Fred Cohen and J. L. Selfridge, Not every number is the sum or difference of two prime powers, Math. Comp. 29 (1975), 79-81.
- Eric Weisstein's World of Mathematics, Brier Number
Crossrefs
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.
Comments