Modern cryptography is largely based on complexity assumptions, for example, the ubiquitous RSA is based on the supposed complexity of the prime factorization problem. Thus, it is of fundamental importance to understand how a quantum computer would eventually weaken these algorithms. In this paper, one follows Feynmans prescription for a computer to simulate the physics corresponding to the algorithm of factoring a large number $N$ into primes. Using Dirac-Jordan transformation theory one translates factorization into the language of quantum hermitical operators, acting on the vectors of the Hilbert space. This leads to obtaining the ensemble of factorization of $N$ in terms of the Euler function $varphi(N)$, that is quantized. On the other hand, considering $N$ as a parameter of the computer, a Quantum Mechanical Prime Counting Function $pi_{QM}(x)$, where $x$ factorizes $N$, is derived. This function converges to $pi(x)$ when $Ngg x$. It has no counterpart in analytic number theory and its derivation relies on semiclassical quantization alone.