login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A247138 Least k >= 0 such that 2n+1 - 2^k is a prime power, or -1 if no such k exists. 0

%I #9 Nov 21 2014 01:44:00

%S -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,

%T 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,

%U 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

%N Least k >= 0 such that 2n+1 - 2^k is a prime power, or -1 if no such k exists.

%C It seems to make no difference whether one requires a prime power > 1 or a prime power including 1.

%C While such k >= 0 exists for most odd numbers 2n+1, there are only very few even numbers of this form.

%o (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

%Y Cf. A000079, A000961.

%K sign

%O 0,12

%A _M. F. Hasler_, Nov 20 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 28 15:17 EDT 2024. Contains 374698 sequences. (Running on oeis4.)