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!)
A093049 n-1 minus exponent of 2 in n, a(0) = 0. 4

%I #12 Jul 08 2022 08:23:03

%S 0,0,0,2,1,4,4,6,4,8,8,10,9,12,12,14,11,16,16,18,17,20,20,22,20,24,24,

%T 26,25,28,28,30,26,32,32,34,33,36,36,38,36,40,40,42,41,44,44,46,43,48,

%U 48,50,49,52,52,54,52,56,56,58,57,60,60,62,57,64,64,66,65,68

%N n-1 minus exponent of 2 in n, a(0) = 0.

%F Recurrence: a(2n) = a(n) + n - 1, a(2n+1) = 2n.

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

%e G.f. = 2*x^3 + x^4 + 4*x^5 + 4*x^6 + 6*x^7 + 4*x^8 + 8*x^9 + 8*x^10 + ... - _Michael Somos_, Jan 25 2020

%t a[ n_] := If[ n == 0, 0, n - 1 - IntegerExponent[n, 2]]; (* _Michael Somos_, Jan 25 2020 *)

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

%o (PARI) {a(n) = if( n, n - 1 - valuation(n, 2))}; /* _Michael Somos_, Jan 25 2020 */

%o (Python)

%o def A093049(n): return n-1-(~n& n-1).bit_length() if n else 0 # _Chai Wah Wu_, Jul 07 2022

%Y a(n) = n - A007814(n) - 1 = A093048(n) - 1, n>0.

%Y a(n) is the exponent of 2 in A001761(n+1), A002105(n), A002682(n-1), A006963(n), A036770(n-1), A059837(n), A084623(n), |A003707(n)|, |A011859(n)|.

%K nonn

%O 0,4

%A _Ralf Stephan_, Mar 16 2004

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 24 03:08 EDT 2024. Contains 371918 sequences. (Running on oeis4.)