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

 

Logo

Thanks to everyone who made a donation during our annual appeal!
To see the list of donors, or make a donation, see the OEIS Foundation home page.

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A050601 Recursion counts for summation table A003056 with formula a(0,x) = x, a(y,0) = y, a(y,x) = a((y XOR x),2*(y AND x)) 2
0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 2, 1, 2, 0, 0, 1, 2, 2, 1, 0, 0, 2, 1, 1, 1, 2, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 3, 2, 3, 1, 3, 2, 3, 0, 0, 1, 3, 3, 2, 2, 3, 3, 1, 0, 0, 2, 1, 3, 2, 1, 2, 3, 1, 2, 0, 0, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 0, 0, 3, 2, 3, 1, 3, 1, 3, 1, 3, 2, 3, 0, 0, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 0, 0, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 0 (list; table; graph; refs; listen; history; text; internal format)
OFFSET

0,12

LINKS

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

FORMULA

a(n) -> add2c( (n-((trinv(n)*(trinv(n)-1))/2)), (((trinv(n)-1)*(((1/2)*trinv(n))+1))-n) )

MAPLE

add2c := proc(a, b) option remember; if((0 = a) or (0 = b)) then RETURN(0); else RETURN(1+add_c(XORnos(a, b), 2*ANDnos(a, b))); fi; end;

MATHEMATICA

trinv[n_] := Floor[(1/2)*(Sqrt[8*n + 1] + 1)];

Sum2c[a_, b_] := Sum2c[a, b] = If[0 == a || 0 == b, Return[0], Return[ Sum2c[BitXor[a, b], 2*BitAnd[a, b]] + 1]];

a[n_] := Sum2c[n - (1/2)*trinv[n]*(trinv[n] - 1), (trinv[n] - 1)*(trinv[ n]/2 + 1) - n];

Table[a[n], {n, 0, 120}](* Jean-Fran├žois Alcover, Mar 07 2016, adapted from Maple *)

CROSSREFS

Cf. A050600, A050602, A003056, A048720 (for the Maple implementation of trinv and XORnos, ANDnos)

Sequence in context: A101664 A091952 A108803 * A101650 A287411 A053796

Adjacent sequences:  A050598 A050599 A050600 * A050602 A050603 A050604

KEYWORD

nonn,tabl

AUTHOR

Antti Karttunen, Jun 22 1999

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 January 19 16:21 EST 2019. Contains 319307 sequences. (Running on oeis4.)