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!)
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 (list; graph; refs; listen; history; text; internal format)
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

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 10:11 EDT 2024. Contains 371935 sequences. (Running on oeis4.)