login
A194591
Least k >= 0 such that n*2^k - 1 or n*2^k + 1 is prime, or -1 if no such value exists.
15
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,13
COMMENTS
Fred Cohen and J. L. Selfridge showed that a(n) = -1 infinitely often.
a(n) = 0 iff n is in A045718.
A217892 and A194600 give indices and values of the records.
REFERENCES
Fred Cohen and J. L. Selfridge, Not every number is the sum or difference of two prime powers, Math. Comput. 29 (1975), 79-81.
LINKS
Arkadiusz Wesolowski, Table of n, a(n) for n = 1..1000
Eric Weisstein's World of Mathematics, Brier Number
FORMULA
If a(n)>0, then a(2n)=a(n)-1.
EXAMPLE
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.
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 *)
KEYWORD
sign
AUTHOR
STATUS
approved