Hosted by The Math Forum


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)0Source: 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

The Math Forum is a research and educational enterprise of the Drexel University School of Education.