I understand the problem well enough and I'm trying to understand the algorithm, Shor's version. It's not easy to read the abstract descriptions available everywhere --- Shor's paper, Nielsen's book and many others. I will build a numerical example --- various numerical examples --- if none are available out there, but if you know any that will be a nice start.
If you don't know any, feel free to give me directions on how to build it. For instance, I have already understood that a key step to the algorithm is setting up two registers |a>|b> and then applying a circuit that takes |$a$>|$b$> to |$y\oplus g^a x^{-b}$>, where $g$ is a generator and $x$ is the number whose logarithm we want to find. (The computation is be reduced mod $p$.) (Of course, $y$ is to be initialized to zero.)
The next step is to compute the QFT, something I've never done and looks a bit difficult, so I will consider the previous step a mile stone for now. I think that at the previous step I will have a superposition of all possible values of the pair $(a,b)$ and so the QFT would only serve to amplify the states that are interesting.
As you can see, more than examples, I'm looking for careful steps and explanations. I'll appreciate any help on this.