login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A135523
a(n) = A007814(n) + A209229(n).
5
1, 2, 0, 3, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 5, 0, 1, 0, 2, 0, 1, 0, 3, 0
OFFSET
1,2
LINKS
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
This is Guy Steele's sequence GS(4, 1) (see A135416).
One less than A135560.
Sequence in context: A219202 A341980 A218031 * A194663 A135685 A349447
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, based on a message from Guy Steele and Don Knuth, Mar 01 2008
STATUS
approved