After teenage Sri Lankan Ranjit Subramanian, a math prodigy, reconstructs and publishes the famous last theorem of Pierre de Fermat, the powerful aliens called the Grand Galactics respond to the flash of nuclear explosions and decide to exterminate humanity just as Earth's superpowers develop a new, nonlethal, way of promoting global peace.