OFFSET
1,2
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
FORMULA
G.f.: x + Sum_{k>=1} x^(2^k)*(1 + 1/(1 - x^(2^k))). - Ilya Gutkovskiy, Mar 30 2017
a(n) = A135560(n) - 1. Antti Karttunen, Sep 27 2018
MAPLE
GS(4, 1, 200); [see A135416].
PROG
(PARI) A135523(n) = (valuation(n, 2)+(n && !bitand(n, n-1))); \\ Antti Karttunen, Sep 27 2018
(Python)
def A135523(n): return (~n& n-1).bit_length()+int(not(n&-n)^n) # Chai Wah Wu, Jul 08 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, based on a message from Guy Steele and Don Knuth, Mar 01 2008
STATUS
approved