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!)
A089263 First differences of A080791. 1

%I #15 Sep 27 2018 17:54:53

%S 0,0,1,-1,2,-1,0,-1,3,-1,0,-1,1,-1,0,-1,4,-1,0,-1,1,-1,0,-1,2,-1,0,-1,

%T 1,-1,0,-1,5,-1,0,-1,1,-1,0,-1,2,-1,0,-1,1,-1,0,-1,3,-1,0,-1,1,-1,0,

%U -1,2,-1,0,-1,1,-1,0,-1,6,-1,0,-1,1,-1,0,-1,2,-1,0,-1,1,-1

%N First differences of A080791.

%C Number of trailing zeros in the binary representation of n, minus one if n is not a power of two.

%C a(0) = 0 by convention. - _Antti Karttunen_, Sep 27 2018

%H Antti Karttunen, <a href="/A089263/b089263.txt">Table of n, a(n) for n = 0..65537</a>

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>

%F a(0)=0, a(2n) = a(n) + 1, a(2n+1) = -1 + [n==0].

%F a(n) = A007814(n) + A036987(n-1) - 1.

%F G.f.: sum(k>=0, t^2/(1+t), t=x^2^k).

%F a(n) = A080791(n+1) - A080791(n). - _Antti Karttunen_, Sep 27 2018

%o (PARI) a(n)=if(!n,n,(valuation(n, 2)+(2^valuation(n, 2)==n)-1)); \\ Check for n=0 added by _Antti Karttunen_, Sep 27 2018

%o (PARI) a(n)=if(n<1,0,if(n%2==0,a(n/2)+1,-1+(((n-1)/2)==0)))

%Y Cf. A080791, A088705.

%K sign,easy

%O 0,5

%A _Ralf Stephan_, Oct 30 2003

%E Definition corrected (A023416 replaced with A080791) by _Antti Karttunen_, Sep 27 2018

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 April 19 05:02 EDT 2024. Contains 371782 sequences. (Running on oeis4.)