login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A231204 If n = Sum_{i=0..m} c(i)*2^i, c(i) = 0 or 1, then a(n) = (m-i)*c(i). 1
0, 0, 0, 1, 0, 2, 1, 3, 0, 3, 2, 5, 1, 4, 3, 6, 0, 4, 3, 7, 2, 6, 5, 9, 1, 5, 4, 8, 3, 7, 6, 10, 0, 5, 4, 9, 3, 8, 7, 12, 2, 7, 6, 11, 5, 10, 9, 14, 1, 6, 5, 10, 4, 9, 8, 13, 3, 8, 7, 12, 6, 11, 10, 15, 0, 6, 5, 11, 4, 10, 9, 15, 3, 9, 8, 14, 7, 13, 12, 18, 2, 8, 7, 13, 6, 12, 11, 17, 5, 11, 10, 16, 9, 15, 14, 20, 1, 7, 6, 12 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,6

COMMENTS

A literal interpretation of the binary numbers.

LINKS

Table of n, a(n) for n=0..99.

EXAMPLE

For n=13 we have 1101, so we add 0+1+3=4, getting a(13)=4.

MAPLE

f:=proc(n) local t1, m, i;

t1:=convert(n, base, 2);

m:=nops(t1)-1;

add((m-i)*t1[i+1], i=0..m);

end; # N. J. A. Sloane, Nov 08 2013

PROG

(JavaScript)

for (i=0; i<100; i++) {

s=i.toString(2);

o=0;

sl=s.length;

for (j=0; j<sl; j++) if (s.charAt(j)==1) o+=j;

document.write(o+", ");

}

CROSSREFS

Cf. A029931. See A230877 for another version.

Cf. A000523.

Sequence in context: A066029 A141198 A239621 * A180987 A092093 A197386

Adjacent sequences:  A231201 A231202 A231203 * A231205 A231206 A231207

KEYWORD

nonn,base

AUTHOR

Jon Perry, Nov 05 2013

EXTENSIONS

Edited by N. J. A. Sloane, Nov 08 2013

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 18 08:04 EDT 2019. Contains 328146 sequences. (Running on oeis4.)