[go: up one dir, main page]

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!)
Revision History for A050601 (Underlined text is an addition; strikethrough text is a deletion.)

Showing all changes.
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))
(history; published version)
#7 by Bruno Berselli at Mon Mar 07 11:58:29 EST 2016
STATUS

proposed

approved

#6 by Jean-François Alcover at Mon Mar 07 11:56:23 EST 2016
STATUS

editing

proposed

#5 by Jean-François Alcover at Mon Mar 07 11:56:15 EST 2016
MATHEMATICA

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

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];

(trinv[n] - 1)*(trinv[n]/2 + 1) - n];

Table[a[n], {n, 0, 120}]}](* _Jean-François Alcover_, Mar 07 2016, adapted from Maple *)

#4 by Jean-François Alcover at Mon Mar 07 11:54:16 EST 2016
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}]

STATUS

approved

editing

#3 by Charles R Greathouse IV at Thu May 01 02:47:40 EDT 2014
AUTHOR

_Antti Karttunen _, Jun 22 1999

Discussion
Thu May 01 02:47
OEIS Server: https://oeis.org/edit/global/2208
#2 by N. J. A. Sloane at Fri May 16 03:00:00 EDT 2003
KEYWORD

nonn,tabl,new

AUTHOR

Antti.Karttunen@iki.fi (karttu@megabaud.fi) 22-JUN-1999

Antti Karttunen Jun 22 1999

#1 by N. J. A. Sloane at Sat Dec 11 03:00:00 EST 1999
NAME

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))

DATA

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

OFFSET

0,12

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;

CROSSREFS

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

KEYWORD

nonn,tabl

AUTHOR

Antti.Karttunen@iki.fi (karttu@megabaud.fi) 22-JUN-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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 30 00:57 EDT 2024. Contains 375520 sequences. (Running on oeis4.)