The Sc@ C 82 endohedral fullerenes inside a single-wall semiconducting or metallic nanotube form a welldefined chain of antiferromagnetically coupled spins. Using hybrid density functional theory ͑DFT͒, we find that the spin resides mainly on the fullerene cage, whether or not the fullerenes are in a nanotube. The spin interactions decay exponentially with fullerene separation and the system can be described by a simple antiferromagnetic Heisenberg spin chain. Energy parameters for a generalized Hubbard-Anderson model are deduced from the DFT calculations and yield a second-order Heisenberg exchange energy, which is in good agreement with total-energy calculations for parallel and antiparallel spin configurations. Within the accuracy of the calculations, neither semiconducting nor metallic nanotubes affect the interactions between the fullerene electron spins.