login
A247138
Least k >= 0 such that 2n+1 - 2^k is a prime power, or -1 if no such k exists.
0
-1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 2, 1, 1, 1, 1, 0, 2, 3, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 4, 1, 1, 0, 3, 1, 2, 1, 1, 2, 3, 1, 1, 1, 2, 3, 1, 2, 4, 3, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 4, 3, 1, 2, 1, 0, 2, 1, 2, 4, 1, 1, 2, 3, 3, -1, 1, 1, 2, 3, 1, 2, 5, 1, 2, 1, 1, 2, 1, 2, 4, 1, 1, 2, 3, 3, 6, 1, 1, 2, 1, 1, 2, 3, 3, 4, 5, 1, 2, 7, 3, 6, 5, 1, 2, 1, 1, 2, 1, 2, 4, 1, 1, 1, 2, 3, 3, 1, 2, 0, 1, 2
OFFSET
0,12
COMMENTS
It seems to make no difference whether one requires a prime power > 1 or a prime power including 1.
While such k >= 0 exists for most odd numbers 2n+1, there are only very few even numbers of this form.
PROG
(PARI) a(n)=for(k=0, log(n=n*2+1)\log(2)+1, (/*n-2^k==1 ||*/ isprimepower(n-2^k))&&return(k)); -1
CROSSREFS
Sequence in context: A059883 A086967 A098490 * A212627 A029419 A165105
KEYWORD
sign
AUTHOR
M. F. Hasler, Nov 20 2014
STATUS
approved