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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A198192 Replace 2^k in the binary representation of n with n-k (i.e. if n = 2^a + 2^b + 2^c + ... then a(n) = (n-a) + (n-b) + (n-c) + ...). 2
0, 1, 1, 5, 2, 8, 9, 18, 5, 15, 16, 29, 19, 34, 36, 54, 12, 30, 31, 52, 34, 57, 59, 85, 41, 68, 70, 100, 75, 107, 110, 145, 27, 61, 62, 99, 65, 104, 106, 148, 72, 115, 117, 163, 122, 170, 173, 224, 87, 138, 140, 194, 145, 201, 204, 263, 156, 216, 219, 282, 226 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

LINKS

Alois P. Heinz, Table of n, a(n) for n = 0..10000

FORMULA

a(n) = n*A000120(n) - A073642(n). - Franklin T. Adams-Watters, Oct 22 2011

a(n) = b(n,n) with b(0,k) = 0, b(n,k) = k*(n mod 2) + b(floor(n/2),k-1) for n>0. - Alois P. Heinz, Oct 25 2011

EXAMPLE

a(5) = (5-2) + (5-0) = 8 because 5 = 2^2 + 2^0.

a(7) = (7-2) + (7-1) + (7-0) = 18 because 7 = 2^2 + 2^1 + 2^0.

MAPLE

b:= (n, k)-> `if`(n=0, 0, k*(n mod 2)+b(floor(n/2), k-1)):

a:= n-> b(n, n):

seq(a(n), n=0..100);  # Alois P. Heinz, Oct 25 2011

PROG

(MATLAB) % n is number of terms to be computed:

function [B] = predAddition(n)

   for i = 0:n

      k = i;

      c = 0;

      s = 0;

      while(k ~= 0)

         if ((i - c) >= 0)

            s = s + mod(k, 2)*(i-c);

         end

         c = c + 1;

         k = (k - mod(k, 2))/2;

      end

      B(i+1) = s;

   end

end

CROSSREFS

Cf. A000120, A073642.

Sequence in context: A001062 A187876 A179951 * A046878 A078335 A021658

Adjacent sequences:  A198189 A198190 A198191 * A198193 A198194 A198195

KEYWORD

nonn,look,base

AUTHOR

Brian Reed, Oct 21 2011

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 November 17 11:02 EST 2019. Contains 329226 sequences. (Running on oeis4.)