**Hosted by The Math Forum
**

Spring 2000 Archive || MacPOW Home || Math Forum POWs || Search MacPOW

Find an algorithm for writing any positive integer in negabinary, i.e., as a sum of powers of -2.

For example,

7 = 11011 = (-2)^{4}+ (-2)^{3}+ (-2)^{1}+ (-2)^{0}19 = 10111 = (-2)^{4}+ (-2)^{2}+ (-2)^{1}+ (-2)^{0}Source: This was a "contest problem" at a recent Mathematica conference. It was communicated to us by Stan Wagon.© Copyright 2000 Stan Wagon. Reproduced with permission.

[**Privacy Policy**]
[**Terms of Use**]

Home || The Math Library || Quick Reference || Search || Help

http://mathforum.org/

14 March 2000 (Pi day: 3/14)