Exact Identities for the Binary Hamming Weight Under Arithmetic and Bitwise Operations

Read the full article See related articles

Discuss this preprint

Start a discussion What are Sciety discussions?

Listed in

This article is not in any list yet, why not save it to one of your lists.
Log in to save this article

Abstract

We collect and prove exact identities for the binary digital sum S2(n)—the Hamming weight wt (n)—under elementary arithmetic and bitwise operations. For x, y ≥ 0 we derive explicit carry/borrow decompositions of wt(x + y) and wt (x − y) in terms of bitwise carries/borrows ci, bi (0-based indexing, c0 = b0 = 0). We restate classical XOR/OR/AND weight identities in a unified notation, give shift–mask lemmas yielding constructive corollaries (e.g., forcing a prescribed Hamming weight), and present a 2-adic reformulation linked to Kummer’s theorem. We also discuss algorithmic, hardware, and side-channel applications. Proofs are elementary and self-contained.

Article activity feed