We propose an adiabatic quantum algorithm capable of factorizing numbers, using fewer qubits than Shors algorithm. We implement the algorithm in an NMR quantum information processor and experimentally factorize the number 21. Numerical simulations indicate that the running time grows only quadratically with the number of qubits.