  We propose an iterative scheme to factor numbers based on the quantum
dynamics of an ensemble of interacting bosonic atoms stored in a trap where the
single-particle energy spectrum depends logarithmically on the quantum number.
When excited by a time-dependent interaction these atoms perform Rabi
oscillations between the ground state and an energy state characteristic of the
factors. The number to be factored is encoded into the frequency of the
sinusoidally modulated interaction. We show that a measurement of the energy of
the atoms at a time chosen at random yields the factors with probability one
half. We conclude by discussing a protocol to obtain the desired prime factors
employing a logarithmic energy spectrum which consists of prime numbers only.
