[go: up one dir, main page]

login
Revision History for A065620 (Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing entries 1-10 | older changes
a(0)=0; thereafter a(2n) = 2a(n), a(2n+1) = -2a(n) + 1.
(history; published version)
#43 by Alois P. Heinz at Tue Sep 19 14:23:24 EDT 2023
STATUS

proposed

approved

#42 by Chai Wah Wu at Tue Sep 19 13:36:43 EDT 2023
STATUS

editing

proposed

#41 by Chai Wah Wu at Tue Sep 19 13:36:31 EDT 2023
PROG

return c # Chai Wah Wu, Sep 19 2023

#40 by Chai Wah Wu at Tue Sep 19 13:34:53 EDT 2023
PROG

(Python)

def A065620(n):

c, a, b = 0, -1, 1

for j in bin(n)[-1:1:-1]:

if int(j):

c += (a:=-a)*b

b <<= 1

return c # Chai Wah Wu, Sep 19 2023

STATUS

approved

editing

#39 by Michel Marcus at Tue Sep 05 01:40:53 EDT 2023
STATUS

reviewed

approved

#38 by Joerg Arndt at Tue Sep 05 01:39:35 EDT 2023
STATUS

proposed

reviewed

#37 by Amiram Eldar at Tue Sep 05 01:32:11 EDT 2023
STATUS

editing

proposed

#36 by Amiram Eldar at Tue Sep 05 01:23:33 EDT 2023
REFERENCES

D. Donald E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, 1969, Vol. 2, p. 178, (exercise 4.1. Nr. 27).

EXAMPLE

11 = 1 + 2 + 8 -> 1 - 2 + 8 = 7 = a(11).

#35 by Amiram Eldar at Tue Sep 05 01:22:45 EDT 2023
MATHEMATICA

a[0] = 0; a[n_]:= a[n]= If[OddQ[n], 1 - 2*a[(n-1)/2], 2*a[n/2]]; Array[a, 100, 0] (* Amiram Eldar, Sep 05 2023 *)

STATUS

approved

editing

#34 by N. J. A. Sloane at Wed Apr 25 09:44:35 EDT 2018
STATUS

editing

approved