News for hackers. Stuff that matters.
Re:Fun with math: Dividing one by 998001 yields a surprising... by psykotic on Friday January 27, 2012 @12:36AM (#3517263)
Nice trick. It works in any even base b:

    xy = b((x - b/2) + (y - b/2)) + (b - x)(b - y)
For b = 2 in particular, x - b/2 and x - b/2 are the negative 1's complements of x and y, and b - x and b - y are the 2's complements. More generally, they are the same kinds of complements generalized to base b.

Because of that symmetric relationship with complementation, I suspect there is a conceptual proof waiting to be found. By conceptual I mean something that isn't just blind formula crunching. That would get us much closer to "why".

There are no comments on this comment yet.