In order to provide a numerical criterion for superconductivity, the ground state energy
E0(\ensuremath{\Phi}) is calculated for the attractive and repulsive Hubbard models on a cylinder geometry threaded by a flux \ensuremath{\Phi}. From the functional form of
E0(\ensuremath{\Phi}), superconducting ground states may be identified without prior knowledge of the pairing symmetry.
E0(\ensuremath{\Phi}) is calculated with Monte Carlo methods. For the attractive Hubbard model, our results confirm the existence of a superconducting ground state. In contrast, our results show that the quarter-filled repulsive Hubbard model is not superconducting and that a Hartree-Fock paramagnetic approximation fits the data very well.