Kaprekar's Routine

The Kaprekar Engine

A concept by Benjamin J Mudge

Feed the machine any 4-digit number. The gears sort its digits, subtract, and turn again — until every number in the universe funnels down to the same resting place: 6174.

Why it's beautiful

Kaprekar's routine is a mathematical attractor: a simple, deterministic rule that pulls every possible input into one stable state. No randomness, no exceptions — just a funnel carved into the number system itself. Discovered in 1949 by D. R. Kaprekar, a self-taught Indian schoolteacher with no university position.

Why it can't power anything

Computation costs energy — it never creates it. Every cycle of this routine, on any machine, consumes electricity and releases heat (Landauer's principle). And because the routine converges and stops, it can't drive a loop. A wheel that always rolls to the same resting spot can't keep turning on its own.

The real mission: freshwater

Data centers don't just burn electricity — they drink. Evaporative cooling at a large facility can consume millions of gallons of freshwater a day, often in regions that can least spare it. Every watt of waste heat captured and reused is heat the cooling towers never have to remove — which means less water evaporated, gallon for gallon. Heat recovery and water conservation are the same lever, pulled once.

The instinct behind this engine — that the flood of data in the world must be good for something — points at real engineering. Algorithms already decide when and where computation runs; Google's AI cut its cooling energy by roughly 40%, and cities in Finland and Denmark heat homes with server exhaust. The next step is an algorithm designed around water: scheduling and placing computation so freshwater consumption falls toward zero. The algorithm doesn't make the power — it makes the power stop costing water. That is the version of this idea worth building.

The blueprint

What the system looks like on paper

One page, whole idea: the data center's hot coolant flows to the algorithm, the algorithm routes that heat to its highest-value uses — thermal storage, district heating, desalination pre-heat — and every watt captured is freshwater the cooling towers never evaporate. The loop measures the savings and tightens itself.

Blueprint schematic of the data center water-saving system: data center, algorithm, heat capture points, and freshwater spared feedback loop

Concept blueprint — Data Center Water-Saving System, DC-WS-001

The whole idea

One algorithm, three problems, one lever

What you're about to read is a single concept, traced from a thought experiment to a real engineering goal. It isn't a machine that makes power from nothing — no such machine exists, and that's a law of physics, not a lack of imagination. It's something more practical: an algorithm-shaped brain that decides how computation and heat flow through a data center, so the facility that runs the world's data stops drinking the world's water.

  1. 1

    Data arrives

    Workloads flood into a data center — AI training, cloud apps, streaming. Each one is compute, and compute is heat.

  2. 2

    The algorithm decides

    A scheduler — shaped by the same spirit as Kaprekar's routine, a simple rule that funnels any input toward a stable state — sorts where and when every workload runs.

  3. 3

    Heat flows on purpose

    Instead of fighting heat with cooling towers, the algorithm steers hot workloads toward capture points: thermal storage, district heating loops, desalination pre-heat.

  4. 4

    Water is spared

    Every watt of heat captured is heat the cooling system never removes — and every gigabyte-hour of cooling avoided is freshwater never evaporated.

  5. 5

    The loop closes

    The facility measures how much water and grid power it saved, feeds that back into the algorithm, and the routine tightens — the same way every number falls to 6174.

Think of it like the distributor on a car engine

A distributor doesn't make power — the engine does. It keeps the timing, sending each spark to the right cylinder at the right moment so nothing is wasted. This algorithm plays the same role for a data center: the facility already produces the heat, and the algorithm keeps the timing of the flow — which workload runs where, which capture point gets the heat, when the cooling towers can stay off. The data center stops being just a consumer and starts behaving like an engine whose exhaust is put to work. The goal is simple: use everything, waste nothing — not the heat, not the water, not the data.

Why freshwater is the target

Power has alternatives — solar, wind, nuclear. Freshwater does not. Cooling a hyperscale facility can pull millions of gallons a day out of local aquifers, in towns that need that water for people. Cutting data-center water use is a problem with a measurable number attached to it, which is what makes it fundable.

Why it's possible now

The pieces already exist separately: Google's AI cooling control cut cooling energy ~40%, Nordic cities heat homes with server exhaust, and workload schedulers already move compute between locations. What's missing is one algorithm built specifically around water — that's the gap this idea fills.

Where this goes next

Step one is a working model: simulate a data center's heat and water budget, run the algorithm against it, and publish the numbers — gallons saved per megawatt-hour. That model is what turns a theory into a pitch that grants, utilities, and sustainability funds can act on.

The field today

Others see the problem. Nobody owns the solution.

This idea doesn't exist in a vacuum — and that's a strength, not a weakness. The pieces are being validated separately right now, by universities and utilities with real budgets. What's missing is anyone combining them into one algorithm built around water.

The research is catching up

  • Water-aware scheduling — a 2026 paper, Balancing Bits and Drops, studies shifting computing workloads to cut freshwater use based on local water stress. arXiv
  • WaterSplit — an optimizer that jointly manages cooling and workload scheduling under a limited water budget. Paper
  • Grid-scale water mapping — a University of Michigan model traces where and when data centers actually consume water across the power grid. arXiv

The hardware is already running

  • Finland — 30MW of data-center waste heat pumped into a city district heating network. Story
  • Denmark — atNorth signed to heat 8,000+ Copenhagen homes with server exhaust. Story
  • Berlin — NTT heating 10,000 residents from existing data centers. Story

The research is papers, not products. The heat projects are plumbing, not software. The open seat — one algorithm that treats freshwater as the thing to be saved, and steers computation and heat accordingly — is still open. That's the seat this project aims for.

Run a data center?

Describe your cooling setup and water constraints, and the planner will sketch a tailored water-reuse concept for your facility — heat capture points, estimated freshwater savings, and a first step.

Try the Water-Reuse Concept Planner