  A simple criterion is derived in order that a number sequence ${\cal S}_n$ is
a permitted spectrum of a quantized system. The sequence of the prime numbers
fulfils the criterion and the corresponding one-dimensional quantum potential
is explicitly computed in a semi-classical approximation. The existence of such
a potential implies that the primality testing can in principle be resolved by
the sole use of physical laws.
