OFFSET
1,3
COMMENTS
LINKS
Iain Fox, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
G.f. = x^2 + 4*x^3 + 4*x^4 + 8*x^5 + 9*x^6 + 12*x^7 + 11*x^8 + 16*x^9 + 17*x^10 + ...
MATHEMATICA
a[n_]:= If[n<1, 0, 2n -2 - IntegerExponent[n, 2]]; (* Michael Somos, Mar 02 2014 *)
PROG
(PARI) a(n)=valuation(4^(n-1)/n, 2); \\ Joerg Arndt, Aug 13 2013
(Sage) [2*n-2 -valuation(n, 2) for n in (1..100)] # G. C. Greubel, Nov 29 2021
(Python)
def A101921(n): return (n-1<<1)-(~n & n-1).bit_length() # Chai Wah Wu, Apr 14 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Ralf Stephan, Dec 21 2004
STATUS
approved