THE RUSSIAN PEASANT multiply by halving, doubling, and adding — older than the pyramids
You can multiply two numbers knowing only how to halve, double, and add. Write the two numbers in columns; repeatedly halve the left (dropping remainders) and double the right; then add up every right-hand entry whose left-hand partner is odd. The odd-rows test is just reading the multiplier’s binary digits — each set bit contributes its shifted copy of the other number. It is binary multiplication in disguise, and it is ancient: the same method sits in the Rhind papyrus, worked by Egyptian scribes over 3,600 years ago.
THE TECHNIQUE halve a, double b, add b when a is odd — binary multiply
The demo multiplies 13×11 by halving/doubling, keeping only the rows where the left column is odd, and checks the sum against the true product: live demo
HISTORY & CREDIT Rhind papyrus ~1650 BCE · ‘Russian peasant’
“Multiplication needs a times-table.” — it needs only halving, doubling, and the parity of one column: binary, four millennia early. cited
the columns · halve a (floor), double b, each step — the left column spells a’s bits from the bottom up. the sum · add b wherever a is odd — a·b = Σ (bitᵢ of a)·(b«i), the binary expansion. ~1650 BCE · the Rhind Mathematical Papyrus (Egypt); the “Russian peasant” name is a 19th-century European label.
A product built from halves, doubles, and one parity test — binary multiplication, older than every written algorithm. resource
RECOMMEND FOR I-13 halving multiply, on the compiler
On the canonical compiler, 13×11 by halve/double/add-on-odd returns 143 — matching the true product:
$ i13 run tk_russianpeasant.i13 # halve a, double b, add b when (a & 1)
RUN OK · 133 step(s) · peak stack 5 · call depth 5
a = 13 b = 11
prod = 143 -- 11 + 22 + ... only the odd-a rows
same = 1 -- equals 13 * 11
Recommend as a NULL, and as history. Russian-peasant multiplication computes the same product as the multiply operator — i13 prints 143 either way — using only shift, add, and a parity mask. It is another resource case (B40): a decomposition of one fixed function into cheaper primitives, output bit-identical. What it adds to the batch is depth of provenance: the “trick” is 3,600 years old, and it is literally a·b = Σ aᵢ(b«i) — the definition of binary multiply. NULL, with the oldest pedigree on the board.