The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A087275 Write n in binary: 1ab..yz, then a(n) = 1b..yz + ... + 1yz + 1z + 1. 1
0, 1, 1, 3, 4, 3, 4, 7, 9, 9, 11, 7, 9, 9, 11, 15, 18, 19, 22, 19, 22, 23, 26, 15, 18, 19, 22, 19, 22, 23, 26, 31, 35, 37, 41, 39, 43, 45, 49, 39, 43, 45, 49, 47, 51, 53, 57, 31, 35, 37, 41, 39, 43, 45, 49, 39, 43, 45, 49, 47, 51, 53, 57, 63, 68, 71, 76 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
COMMENTS
a(n) = A087276(n) - n.
LINKS
FORMULA
a(1) = 0, a(2n) = 2*a(n) + 1, a(2n+1) = 2*a(n) + floor(log_2(n)) + 1.
PROG
(PARI) a(n)=local(v, s, l); v=binary(n); l=length(v); s=0; for(k=2, l, s=s+2^(l-k)+sum(m=k+1, l, v[m]*2^(l-m))); s
CROSSREFS
Sequence in context: A178152 A006984 A361458 * A265305 A072942 A025267
KEYWORD
nonn,easy
AUTHOR
Ralf Stephan, Aug 27 2003
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 May 13 13:35 EDT 2024. Contains 372519 sequences. (Running on oeis4.)